rbaldwin
|
| Posted: 07/03/2002, 9:16 AM |
|
CCS and ASP
I have about 30 tables. Each table has a modifyUser field and a modifyDate field. After updating a table i want to set the modifyUser field to the logged in user and the modifyDate to Now().
I have the AfterExecuteUpdate() code to accomplish the task. However as each table is updated via a different page the code is unique to each page.
For example for the page named f_04AddlBankInf my function is as below.
I'd like to create a generic function and simply pass it the page name. Does anyone know if this is possible. ( i suppose it's more of a vbscript question than a CCS)
Function f_04AddlBankInf_DataSource_AfterExecuteUpdate() 'f_04AddlBankInf_DataSource_AfterExecuteUpdate @2-C3571FD1
'Custom Code @27-73254650
' -------------------------
dim command
command = "update 04AddlBankInfo set modifyDate = now(), modifyUser = " & _
Session("UserID") & " where " & f_04AddlBankInf.DataSource.Where
f_04AddlBankInf.DataSource.Connection.execute (command)
' -------------------------
'End Custom Code
End Function 'Close f_04AddlBankInf_DataSource_AfterExecuteUpdate @2-54C34B28
|
|
|
 |
Chris K.
|
| Posted: 07/03/2002, 12:08 PM |
|
You can append your common subroutine to Common.asp file. Double click Common Files node to open them and switch to Common.asp file.
Subrountine could look like this:
Sub UpdateUserStamp(Table, Where)
CCExecSQL "UPDATE " & Table & " SET modifyDate=now(), modifyUser=" & Session("UserID") & " WHERE " & Where, DBconnection, false
End Sub
Use your connection variable instead of DBconnection. you can call this sub using:
UpdateUserStamp "04AddlBankInfo", f_04AddlBankInf.DataSource.Where
|
|
|
 |
rbaldwin
|
| Posted: 07/03/2002, 12:35 PM |
|
Thanks again Chris for so much help.
|
|
|
 |
|