View Single Post
Old 12-03-07, 07:00 AM   #1
technoid
Registered User
 
Join Date: Jul 2004
Location: Denton, Texas
Posts: 505
Default Learning MySQL using ASP

I'm trying to learn MySQL using ASP and I'm getting a syntax error when I try to add a row to an empty table I created, does anyone know what's wrong with the last line of the code I'm using? Or anything else for that matter. It seems to connect to MySQL but I get the error message below. The name of the table in MySQL is 'order' so that part should be okay, I think, at least I looked and it shows the name 'order'. The 'id' element is auto incrementing and I've tried leaving it out of the update list too. Thanks for any help.

CODE
Quote:
connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr

Set oRS = oConn.Execute ( "INSERT INTO order (id, type, pn, cc) VALUES (NULL, 'SDP3430', '910', '5486')" )
ERROR
Quote:
[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-max-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order (id, type, pn, cc) VALUES (NULL, 'SDP3430', '910', '5486')' at line 1
__________________
Antec-SOLO | ASUS-P5Q-SE | C2D-E8600 | AC-Freezer-7-Pro | Seasonic-S12-550W | 3GB-KVR-PC2-6400 | GTX-560Ti | SB-XtremeGamer | Pioneer-BDR-205 | Samsung-S223B | Dell-U2412M
technoid is offline   Reply With Quote