Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 6th, 2003, 11:56 AM
Authorized User
 
Join Date: Sep 2003
Location: Beaumont, TX, USA.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default No same error with ";"

no .. Same error even after adding ";"

 I am getting the following error
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Missing semicolon (;) at end of SQL statement.

I am trying to insert values into a database. the user submits a form for user id and password and the code enters the password for matching user id
mySQL = "insert into password1 (password) values"
   mySQL = mySQL& "('" & password & "')"
   mySQL = mySQL& " where uid = '" & uid & "'"


   Set objRS2 = objConn.Execute (mySQL)


 
Old October 6th, 2003, 01:58 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can't use a WHERE clause with an INSERT statement. The WHERE is used for SELECT, UPDATE and DELETE queries. Try this:

mySQL = "INSERT INTO password1 (password) VALUES"
   mySQL = mySQL & "('" & password & "')"

If you do need to add the UID as well, modify your statement so it inserts the UID columns as well. If you mean to change the password, your query is OK, except for the INSERT keyword. Change it to UPDATE and it should run fine.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
[Resolved] Error calling a sp - parameter error snufse .NET Framework 2.0 2 February 12th, 2008 04:46 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
Phile Page error, visual studio error reps BOOK: ASP.NET Website Programming Problem-Design-Solution 0 September 27th, 2003 10:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.