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

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

Post by Jason Melv » Tue, 09 Sep 2003 00:38:21


Does column desc allow empty strings?
 
 
 

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

Post by simonoctho » Tue, 09 Sep 2003 00:40:36

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.

 
 
 

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

Post by Ray at <%s » Tue, 09 Sep 2003 00:51:00

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

--
Will trade ASP help for SQL Server help
 
 
 

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

Post by simonoctho » Wed, 17 Sep 2003 18:15:00

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

Cheers,

Simon.
 
 
 

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

Post by PB4FU » Thu, 18 Sep 2003 01:54:52

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

Meindert, MCP