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

Incorrect syntax, please help to check....

Status
Not open for further replies.

choohean

Technical User
Jan 15, 2002
57
MY
Can somebody please help me to check my coding! I try to run this, but the browser will keep feed back with
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Line 1: Incorrect syntax near '('.

this is my coding:


szSQL = "UPDATE traking (status, remark, s_name, s_email, s_dept, s_ext, date_in, time_in) VALUES ('"&status&"','"&remark&"','"&s_name&"','"&s_email&"','"&s_dept&"','"&s_ext&"','"&date_in&"','"&time_in&"') WHERE equip_id='"&equip_id&"' "

set rs = openConn.Execute(szSQL)


I would really thank those who read my thread!
 
I think the statement for UPDATE is like:
UPDATE [table name] SET [column1]=[value1], [column2]=[value2] WHERE [somecolumn]=[somevalue]?
 
Do you want to do an Insert or an Update? (It looks like you have the suntax for both mixed up a little bit.)

In general, the two commands look like this:

INSERT Traking (col1, col2, col3)
VALUES (1, 28, 'Big Bill')


UPDATE Traking SET
col2 = 29,
col3 = 'Little Bill'
WHERE equip_id= 'ABC123'
---------------------------------

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top