insert error

  • Thread starter Thread starter nate
  • Start date Start date
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.
 
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 ©.
 
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.
.
.
 
Back
Top