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!

ERROR '80040e14' : Incorrect syntax near '=' -- but WHY ?? 1

Status
Not open for further replies.

specialist

Programmer
Sep 7, 2001
50
0
0
US
Greetings-

Happy holidays.

I am creating an application which updates a DB and I am getting the following error for a reason unknown to me:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near '='.

add_stepB_NEW_SQLtest.asp, line 52




line 52 =

Set UpdateMainTable = db.execute("UPDATE tblCASInfo SET U_Type = '" & GetUInfo("U_Type") & "', USort = '" & GetUInfo("USort") & "' WHERE CAS_Entry = " & IDField)

----------------
in the above statement,
GetUInfo =

Set GetUInfo = db.execute("SELECT * FROM tblUNames WHERE UName = '" & UName & "'")

------------
UName is a redesignated variable from a form.

I am not sure why the error is happening as it works fine when pointing to an Access DB (this project is a transition from ACCESS to SQL)

Any advice as to how to fix would be greatly welcomed.

thank you in advance for reading this and any direction.

Mike
 
do this and post the response please ..

TempSQL = "UPDATE tblCASInfo SET U_Type = '" & GetUInfo("U_Type") & "', USort = '" & GetUInfo("USort") & "' WHERE CAS_Entry = " & IDField
Response.Write TempSQL
Set UpdateMainTable = db.execute(TempSQL)

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
DreX-

Thanks for the reply and help (again!)

I have added the code as requested and here are the results:


UPDATE tblCASInfo SET U_Type = 'ABC', USort = '5' WHERE CAS_Entry =

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near '='.
.../add_stepB_NEW_SQLtest.asp, line 58


line 58 = Set UpdateMainTable = db.execute(TempSQL)


does the data type have anything to do with this? i have seen similar posts on diff forums where the data type would not be read, but thet would show a type mismatch right?

FYI U_Type and Usort values are correct above. it seems the data is being displayed properly in that matter.

-Mike

 
you're not getting a value for ID field, you need ot validate and dbl check where the value is (not) coming from, it's causing an incomplete SQL statement and leaving an hanging "=" at the end.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
DreX-

Once again, you are correct.

I had the AUTONUMBER field in the .mdb which did not move over in the migration to SQL.

I have since droped and recreated the table with the SQL version of Autonumber which is setting the IDENTITY to "Yes" in the table properties.

Thanks again, I know who to ask if I have any more questions.

Happy Holidays, DreX and thank you again... :)

Mike

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top