| | |
syntax error: i cant find it..HELP!
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
this is the error:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/proj/save.asp, line 26
====
this is my insert into statement:
Dim cat, desc, author, strSQL
cat = request.form("category")
desc = request.form("description")
author = request.form("by")
strSQL = "INSERT INTO " & cat & " (description,ddate,by) VALUES ("
strSQL = strSQL & "'" & trim(desc) & "', "
strSQL = strSQL & "'" & trim(date()) & "', "
strSQL = strSQL & "'" & trim(author) & "') "
mySQLConn.Execute strSQL
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/proj/save.asp, line 26
====
this is my insert into statement:
Dim cat, desc, author, strSQL
cat = request.form("category")
desc = request.form("description")
author = request.form("by")
strSQL = "INSERT INTO " & cat & " (description,ddate,by) VALUES ("
strSQL = strSQL & "'" & trim(desc) & "', "
strSQL = strSQL & "'" & trim(date()) & "', "
strSQL = strSQL & "'" & trim(author) & "') "
mySQLConn.Execute strSQL
•
•
Join Date: Jun 2005
Posts: 107
Reputation:
Solved Threads: 3
Syntax is:
INSERT INTO "tablename" VALUES('.......
Assuming 'cat' is a tablename:
INSERT INTO "tablename" VALUES('.......
Assuming 'cat' is a tablename:
ASP Syntax (Toggle Plain Text)
Dim cat, desc, author, strSQL cat = request.form("category") desc = request.form("description") author = request.form("by") strSQL = "INSERT INTO " & cat & " VALUES ('" & trim(desc) & "', '" & trim(date()) & "', '" & trim(author) & "')" mySQLConn.Execute strSQL
•
•
Join Date: Sep 2004
Posts: 89
Reputation:
Solved Threads: 1
Syntax error in INSERT INTO statement.
This commonly occurs when your field name is a reserved word. Adjust your field names and SQL statement accordingly and you should avoid the problem.
If you can't adjust your fieldnames you can use [ ] marks to delimit the field names, eg
This commonly occurs when your field name is a reserved word. Adjust your field names and SQL statement accordingly and you should avoid the problem.
If you can't adjust your fieldnames you can use [ ] marks to delimit the field names, eg
INSERT INTO table1
([field], [password])
VALUES ('value1', 'value2')
See you have the field name 'by' you should use it like [by]
![]() |
Similar Threads
- Parse error: syntax error, unexpected T_STRING (PHP)
- Can't find Syntax Error (C++)
- Helllppp..> <<invalid Syntax Error>> (Viruses, Spyware and other Nasties)
- IE Syntax Error and Can“t browse some sites (Viruses, Spyware and other Nasties)
- Invalid Syntax Error (Viruses, Spyware and other Nasties)
- declaration syntax error? (C++)
- syntax error that I just can't seem to find! (Visual Basic 4 / 5 / 6)
Other Threads in the ASP Forum
- Previous Thread: Parse XML from ASP!!!
- Next Thread: updating records using asp and mysql
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





