-
Re: SQL & ASP
I have a question.
I`m trying to do an insert into a table and it has a hyphen in the name.
Table Name: wv-InvoiceHeaderTable
I cannot change the table name due to it being used by another application which I don't have the source for or will ever have.
This is what the query looks like:
INSERT INTO wv-InvoiceHeaderTable (Confirmation) VALUES (20)
This is the error message I receive:
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
I know it is the Hyphen because I altered the tablename without it and no problems. So I tried to put quotes around the tablename but that just give me a different error.
Is there anyway to get around this?
Thanks in advance!
-
INSERT INTO [wv-InvoiceHeaderTable] (Confirmation) VALUES (20)
-
Sound so general your problem. Firts be sure your table exist with a simple sql like SELECT * from (your table) after that try to find if your insert value has the same data type like the field you want to insert value and of course you have to know if exist colums in your table that dont accept null values so in this case you have to provide a valid value for all that columns.
-
Want to thank to Monte96 for the solution!
You rock!