Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old January 8th, 2004, 11:12 AM
Registered User
Join Date: Jan 2004
Location: Fort Wayne, IN, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default UPDATE statement returns syntax error

If anyone can identify why I'm getting an error message from this code, please let me know.

I'm getting the error message...
"syntax error in UPDATE statement"

...from the following code...
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = strConnect
objComm.CommandText = "UPDATE clients SET Password = 'calvin' WHERE UserID LIKE 'jdoe'"
objComm.CommandType = adCmdText

The code seems correct. What am I missing?

Also, I would like to substitute variable for both the password and UserID. How would I do that? Would it be something like "UPDATE clients SET Password = " & chr(39) & strPassword & chr(39) & " WHERE UserID LIKE " & chr(39) & strUserID & chr(39) & chr(34)?

Thanks for your help,
Reply With Quote
  #2 (permalink)  
Old January 8th, 2004, 11:23 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,409
Thanks: 0
Thanked 16 Times in 16 Posts

I agree, your update looks alright. There is no more detailed error information?

"UPDATE clients SET Password = '" & strPassword & "' WHERE UserID LIKE '" & strUserID & "'"

Work smarter, not harder.
Reply With Quote
  #3 (permalink)  
Old January 8th, 2004, 04:22 PM
Friend of Wrox
Join Date: Jan 2004
Location: , , USA.
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts

Please post specfic error messages...

If you are using MS Access try enclosing Password column name in the brackets. e.g. [Password], SQL reserved word

Chirag Shah
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Error in the update statement annie_t Access ASP 1 February 1st, 2005 11:48 AM
Syntax error in INSERT INTO statement mega ASP.NET 1.0 and 1.1 Basics 3 January 12th, 2005 03:30 PM
Syntax error on SQL statement Chris1 Access VBA 1 September 7th, 2004 07:47 AM
Syntax error in INSERT INTO statement remnatch Access ASP 9 July 8th, 2004 12:09 PM
Syntax Error in Insert Statement mahulda Classic ASP Databases 2 June 18th, 2004 05:44 AM

All times are GMT -4. The time now is 05:17 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.