What am I doing wrong; problem with INSERT statement (ASP/MS ACCESS)

S

Simom Thorpe

Hi,

I'm trying to insert a line into a MS access DB using ASP on IIS 5.

This is the line:

con.execute "INSERT INTO newProds(title,desc,catcode) VALUES
('Champagne Muff Scarf','','AC304B')"

But it throws up this error:

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

[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
statement.

/admin/import/newprods.asp, line 37

I've been staring at the line for 40 mins now and I can't see a damn
thing wrong with it; hopefully a new set of eyes can see a bug!

What am I doing wrong??

Simon.
 
R

Ray at

desc is a reserved SQL keyword. Either rename your column to DESCRIPTION or
something like that, or bracket the name. i.e.

"INSERT INTP newProds(title,[desc],catcode)...

Ray at home
 
S

Simom Thorpe

Thanx for your help guys, you were right; desc is a reserved word. I
fixed it by using [desc].

Cheers,

Simon.
 
P

PB4FUN

I allways use Descr for Description, you might forget the [] the next time.

Meindert, MCP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top