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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Syntax Error?

Status
Not open for further replies.

Newbie311

Programmer
Oct 6, 2003
30
0
0
GB

sql="insert into users (username,password) values('"&request("text1")&"','"&request("text2")&"')"


Hi there the query above is giving me the following syntax error,any ideas why?


Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/main/test/new.asp, line 19


 
password is a keyword...try wrapping it inside the []

something like this...

sql="insert into users ([username],[password]) values('"&request("text1")&"','"&request("text2")&"')"

hope that helps

-DNG
 
Much appreciated that fixed the problem
cheers!!
 
great...always remember that it is not suggested to use keywords as field names...if you do so wrap them in the square breaces

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top