Click to See Complete Forum and Search --> : Problem inserting values in to table - MsAccess


shanuragu
06-14-2004, 02:33 AM
Hi

Can any plz tell what is wrong with this query - which when I execute I'm getting the following error -

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

I am using msaccess

Please help:(
shanuragu

buntine
06-14-2004, 05:45 AM
Ahh, what query? You havent specified.

shanuragu
06-14-2004, 06:17 AM
Sorry In a hurry I forgot to mention the querry -
here it is

strSQL = "INSERT INTO reg_details(reg_dt, name, phone, email, country, address, zip, state, remarks) VALUES ('"&reg_dt&"', '"&name&"', '"&phone&"', '"&email&"', '"&RsCountry1("country_name")&"', '"&address&"', '"&zipcode&"', '"&state&"', '"&remarks&"')"
Con.Execute strSQL

shanuragu

shanuragu
06-14-2004, 07:51 AM
No problem - I am able to solve the problem. The only mistake I made in the query is the table name. ie, in MS Access table name with "-" (hypen)is not allowed. I just changed the table name reg-details to reg_details.

Thanks for ur help.
Shanuragu

buntine
06-14-2004, 12:38 PM
Oh ok. Good job. ;)

In your initial code, the table name already contained an underscore.