Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax error

Status
Not open for further replies.

ifeyinwa

Programmer
Mar 26, 2003
112
US
Hi Guys,
This is my code , below .i am tryinG to update a table in access.

SQlstmt = "Update BILLTABLE Set "
SQLStmt = SQlstmt & "BILLTITLE = '" & Strbilltitle & "',"
SQLStmt = SQlstmt & "WEBADD = '" & Strwebadd & "',"
SQLStmt = SQlstmt & "KEYWORDS = '" & Strkeywords & "',"
SQLStmt = SQlstmt & "BILLSUMMARY = '" & Strbillsummary & "',"
SQLStmt = SQlstmt & "Where BILLNO = '" & StrbillNo &"'"
Response.write sqlstmt
Conn.Execute(SQLStmt)

Says i have a syntax error,below is the error messaGe

Update BILLTABLE Set BILLTITLE = 'MEDICARE',WEBADD = 'ANDY@MDT',KEYWORDS = 'HEALTH',BILLSUMMARY = 'MEDICAL',Where BILLNO = 'H.R.205'

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

pls which syntax am i missinG??

Thanks as always,
Ify
 
1. Avoid spaces in table and field names.
2. You don't want a comma after the WHERE keyword

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Am sorry , can u show me where exactly in my code i should avoid spaces in the table /field name and remove a comma from the where statement. the where has no comma??
 
The query is working now. thanks.
will now clean it up so it accepts spaces and whatever character user puts in so i get no error message.
 
Easy way to debug sql statements is in an Access module. Just write a short subroutine to debug.print the sql statement. You can step thru it line by line and see the values the variable are returning and if a line fails, you can instantly know which one is giving you headaches. It's the way I deal with that type of stuff.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top