rbaldwin
|
| Posted: 06/20/2002, 12:05 PM |
|
Language=asp
my table has a field lastUpdate.
I want to set it to now() after an Update.
The custom code i have is
==============Custom Code Starts Here============
Function f_00Country_Ban_DataSource_AfterExecuteUpdate() 'f_00Country_Ban_DataSource_AfterExecuteUpdate @2-88DBF07C
'Custom Code @25-73254650
' -------------------------
f_00Country_Ban.DataSource.Connection.Execute _
"UPDATE 00Country_BankData SET modifyDate=now() WHERE ID=" & _
Request.QueryString("ID")
' -------------------------
'End Custom Code
End Function 'Close f_00Country_Ban_DataSource_AfterExecuteUpdate @2-54C34B28
==============Custom Code Ends Here============
The error i'm getting is
Source: Record f_00Country_Ban / Update Operation
Command Text: UPDATE 00Country_BankData SET modifyDate=now() WHERE ID=2
Error description: Cannot update 'ID'; field not updateable. (Microsoft JET Database Engine)
UPDATE [00Country_BankData] SET [Country]='ANTIGUA', [Bank Name]='The Bank of Nova Scotia', [completedby]=?, [title]=?, [phoneno]=?, [faxno]=?, [email]=?, [questionaire#]=5, [datecompleted]=#12/11/2000#, [ID]='2' WHERE [ID] = 2
|
|
|
 |
Nicole
|
| Posted: 06/24/2002, 12:00 AM |
|
Hello,
try following code in AfterUpdate event (it works fine for me):
form_name.DataSource.Connection.execute ("update table_name set date_resolved = now() where primary_key_field = " & form_name.DataSource.Where)
or
form_name.DataSource.Connection.execute ("update table_name set date_resolved = now() where primary_key_field = " & CCToSQL(form_name.DataSource.Where, "Integer"))
|
|
|
 |
rbaldwin
|
| Posted: 06/24/2002, 6:39 AM |
|
Nicole,
I appreciate you helping me, no once else including support offered any suggestions.
I tried your suggestion in my project to no avail. While it throws no errors, it is not updating the date_resolve field.
So, i applied your suggestion to the Tutorial still to no avail.
I would much appreciate if you would zip up a working example for me to see.
Thanks.
Rod.
|
|
|
 |
rbaldwin
|
| Posted: 06/24/2002, 7:25 AM |
|
Nicole, i tried to upload my project but i exceeded a limit, i could email it to you if you wouldn't mind taking a look?
my email isrbaldwin@yahoo.com
|
|
|
 |
rbaldwin
|
| Posted: 06/24/2002, 11:44 AM |
|
Figured it out!!!!
f_00Country_Ban.DataSource.Where returns -> [ID] = 2 , I had expected it would return only the "2"
My code
=======================
dim command
command = "update 00Country_BankData set modifyDate = now() where " & f_00Country_Ban.DataSource.Where
f_00Country_Ban.DataSource.Connection.execute (command)
|
|
|
 |
|