Click to See Complete Forum and Search --> : Something overlooked with SQL?


TNO
03-29-2008, 08:27 PM
Hopefully this is some simple error I'm overlooking in syntax. I get the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e09'

[TCX][MyODBC]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 ''TestUser','Sun Mar 30 00:17:42 UTC 2008','Foo bar text')' at line 1

/temp/chatBox.asp, line 35

And here is the related lines (JScript):

SQL = "CREATE TABLE t_chat("+
"name VARCHAR(20),"+
"date VARCHAR(40),"+
"msg VARCHAR(100)"+
");";
adoConn.Execute(SQL);

//add a test record
var dt = new Date();
SQL = "INSERT INTO t_chat"+
"VALUES ('TestUser','"+ dt +"','Foo bar text');";
adoConn.Execute(SQL); //<-- Line 35

Any suggestions? Or is more info needed?

TNO
03-29-2008, 08:31 PM
nevermind, it was something simple.....I forgot a space.

SQL = "INSERT INTO t_chat"+ ---> SQL = "INSERT INTO t_chat "+