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

INSERT INTO error 1

Status
Not open for further replies.

guyphil

Programmer
Nov 2, 2004
27
IL
Hi

I keep getting:

Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

Iv'e checked the code over and over and cant find the glitch.

can anyone tell me if they see something.

Set rstSimple=Server.CreateObject("ADODB.Recordset")
sql=" INSERT INTO USERS (TYPEOFBUS, FIRSTN, LASTN, CITY, STATE, COUNTRY, ZIP, USERNAME, PASSWORD, PHONE1, PHONE2, CELL, FAX, EMAIL)"
sql=sql & " VALUES ('" & typeOfBusiness & "','" & firstName & "','" & lastName & "','" & city & "','" & dstate & "','" & country & "'," & zip & ",'" & usern & "','" & passw & "'," & phone1 & "," & phone2 & "," & cell & "," & fax & ",'" & email & "')"
rstSimple.Open sql, cnnSimple, 3

Thanks

Guyphil
 
username, password, and email can be reserved words in some SQL dialects

either change your column names or surround them with square brackets (,[username],) in the SQL statement.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Hey Chris,

Thanks for the reply. I tried both surrounding the 3 parameters in square brackets (still get error), then I removed the brackets and renamed to usern, passw, eml.
Still getting the same error. I cut and paste the database fields straight from access to ensure there wouldn't be any spelling errors. Have any other ideas maybe? Just wondering, if you are familiar with asp.net, do you know if the errors are just as ambiguous?

Many Thanks,

Guyphil.
 
Write out your query using

Response.Write(sql)

and see what actual query is getting passed...

also post both the query and the response.write ouput

-L

 
(Follow the write with Response.Flush so it will appear on the screen along with the error message.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top