-
SQL and JAVA with Acces DataBase
I have this String that I am trying to insert information into a database. It Keeps giving me a-- '[Microsoft][ODBC Microsoft Access Drive] Syntax error in INSERT INTO statement.'
here is the code:
String stmtSource = "INSERT into tblsyst" + "(Box, Height1, Level1, Main)" + "values ('" + one + "', '" +
two + "', '" +
three + "', '" +
four + "')";
what is causing this error?
-
This forum is for the ASP-db product. You can use this DLL to access all the datasources, VB, C# or J#. In you case, try to cut and paste your SQL into Access query and check for validity.
Frank
-
Tried something
Hey Frank, I tried what ya told me too and it says the + sign after tblsyst" is causing something. I have another INSERT statement and its works great. I have it set up all the same way. Any Ideas.??
-
post the exact SQL statement that you type in tehAccess query that fails and the one that works. The "+" is the code and the SQL statement should be a string. Post exactly what you type in the Access query.
Fk
-
I still can't figure it out. On the good sql statement it errored out at the ' + '. ANy more Ideas?
-
you have to post the SQL queries, otherwise, nobody would know what you are talking about. Do not post the one in your code, post the one you use in the Access query. That i sthe one that counts. You can then figuer how to produce that with code. Also, use the Northwind example and not your own DB. That way, those who wants to help you can test that as well as yourself.
Frank
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|