dhodgdon
Posts: 80
|
| Posted: 08/11/2004, 9:50 AM |
|
I have a form that following a successful "Add" I want to update a specific value in a record not associated with the form. I put code in Function Results_DataSource_AfterExecuteInsert() but it errors out all the time.
I referenced forum post http://forums.codecharge.com/posts.php?post_id=42870 which seems to have this included in it but still can't get it to work or find a reasonalble explanation in CCS help (local and on-line).
Here are the particulars:
Database is MS Access
Table containing record to be updated: Users
Column to be updated with text "Yes" : SUNWUSB
Record is selected by matching the CCGetUserID() to the column USERID
The problamatic code is:
dim dbconnection
set dbconnection = New clsDBccFAESurvey
dbconnection.open
dbconnection.Execute("UPDATE users SET SUNWUSB = "Yes" WHERE userid=" "& dbconnection.ToSQL(CCGetUserID(),ccsInteger)")
dbconnection.close
The error being returned by IE 6:
Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/SCONFAESurvey/Sunday_WUSB_events.asp, line 22, column 50
dbconnection.Execute("UPDATE users SET SUNWUSB = "Yes" WHERE userid=" "& dbconnection.ToSQL(CCGetUserID(),ccsInteger)")
Any and all help appricated including an easier way in CCS.
_________________
Regards,
David Hodgdon
|
 |
 |
dataobjx
Posts: 181
|
| Posted: 08/11/2004, 12:48 PM |
|
One error that I see right away is that you're using quotes in the SQL.
You need to use an apostrophe instead.
dbconnection.Execute("UPDATE users SET SUNWUSB = "Yes" WHERE userid=" "& dbconnection.ToSQL(CCGetUserID(),ccsInteger)")
Should Be;
dbconnection.Execute("UPDATE users SET SUNWUSB = 'Yes' WHERE userid=" & dbconnection.ToSQL(CCGetUserID(),ccsInteger))
Hope this helps.
_________________
www.DataObjx.net
www.mydigitalapps.com |
 |
 |
dhodgdon
Posts: 80
|
| Posted: 08/11/2004, 6:27 PM |
|
The quotes were the problem.
Thanks!
_________________
Regards,
David Hodgdon
|
 |
 |
|