mramirez18
Posts: 56
|
| Posted: 06/05/2006, 6:54 AM |
|
Can someone tell me why when I submit a record.
dbo_users id is 122 and dbo_reports is 121. I am using the following code.
Function dbo_users_Button_Insert_OnClick() 'dbo_users_Button_Insert_OnClick @25-D275D92F
Dim SQL
Dim RecordSet
Dim GetLastInsKey
'Custom Code @99-73254650
' SQL="INSERT INTO dbo_reports (userid)"
' DBPoacm.Execute(SQL)
'Get User ID
'This method compatible with all databases (unsafe when multiple users insert records at the same time)
'Use your own method for your database.
GetLastInsKey = CCDLookup("max(userid)", "dbo_users", "",DBpoacm)
SQL = "INSERT INTO dbo_reports (userid) " _
& "VALUES (" & DBPoacm.ToSQL(GetLastInsKey,ccsInteger) _
& ")"
DBPoacm.Execute(SQL)
Redirect = "EditableGridAddButton.asp?userid=" & GetLastInsKey
'End Custom Code
Then when I submit record using editable grid, to add reports the userid is deleted.
|
 |
 |
|