insert error

N

nate

Hi i'm receiving -
Syntax error in INSERT INTO statement.

i'm using:

Set objCmd = Server.CreateObject("ADODB.Command")
Set objCmd.ActiveConnection = conn

objCmd.CommandText = "INSERT INTO portfolio
(title,date,dimensions,medium,type,file) VALUES
('test','test','test','test','test','test')"

objCmd.CommandType = adCmdText

'Execute the Command
objCmd.Execute

all the fields in the db are present and are correct.
my db connection works.
what am i doing wrong???
many thanks in advance.
 
M

Mike O'Brien

Hi Nate,

You are using a reserved word (date) for a field in your
portfolio table. You'll need to surround the field with
[], i.e., INSERT INTO portfolio (title,[date],dimensions...

Mike ©.
 
N

nate

that was it. thank you.
-----Original Message-----
Hi Nate,

You are using a reserved word (date) for a field in your
portfolio table. You'll need to surround the field with
[], i.e., INSERT INTO portfolio (title, [date],dimensions...

Mike ©.
-----Original Message-----
Hi i'm receiving -
Syntax error in INSERT INTO statement.

i'm using:

Set objCmd = Server.CreateObject("ADODB.Command")
Set objCmd.ActiveConnection = conn

objCmd.CommandText = "INSERT INTO portfolio
(title,date,dimensions,medium,type,file) VALUES
('test','test','test','test','test','test')"

objCmd.CommandType = adCmdText

'Execute the Command
objCmd.Execute

all the fields in the db are present and are correct.
my db connection works.
what am i doing wrong???
many thanks in advance.
.
.
 

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

Top