CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Problem trying to update a record value via ASP custom code

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
dhodgdon

Posts: 80
Posted: 08/11/2004, 6:27 PM

The quotes were the problem.

Thanks!
_________________
Regards,
David Hodgdon
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.