S
Sérgio Almeida
Greetings
I'm having problems adding records to an access database.
What I want to do is very simple. Here is my code.
__CODE_START__
dim sqlStatement
sqlStatement="insert into Records(artist,album,format,label,tracks,year)
values ('Pink Floyd','THE WALL','2CD','EMI',99,1979)"
dim dataConn
dim strDatabase, affecetd
strDatabase="database/musicstore.mdb"
Set dataConn = Server.CreateObject("ADODB.Connection")
dataConn.Provider="Microsoft.Jet.OLEDB.4.0"
dataConn.ConnectionTimeout = 15
dataConn.CommandTimeout = 30
dataConn.Open Server.MapPath(strDatabase)
dataconn.Execute sqlStatement,affected',adCmdText ' <- ERROR OCCURS HERE
if affecetd = 1 then
Response.Write("<h1> success </h1>")
end if
__CODE_END__
when I try run the cript I get the error
__ERROR_START__
Technical Information (for support personnel)
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/MusicStore/addrecord.asp, line 53
__ERROR_END__
If I run the sabe sql statement on "query analyser" of access, it works
ok (the record is inserted).
What can be the problem? any ideas?
Than you very much
Sérgio Almeida
I'm having problems adding records to an access database.
What I want to do is very simple. Here is my code.
__CODE_START__
dim sqlStatement
sqlStatement="insert into Records(artist,album,format,label,tracks,year)
values ('Pink Floyd','THE WALL','2CD','EMI',99,1979)"
dim dataConn
dim strDatabase, affecetd
strDatabase="database/musicstore.mdb"
Set dataConn = Server.CreateObject("ADODB.Connection")
dataConn.Provider="Microsoft.Jet.OLEDB.4.0"
dataConn.ConnectionTimeout = 15
dataConn.CommandTimeout = 30
dataConn.Open Server.MapPath(strDatabase)
dataconn.Execute sqlStatement,affected',adCmdText ' <- ERROR OCCURS HERE
if affecetd = 1 then
Response.Write("<h1> success </h1>")
end if
__CODE_END__
when I try run the cript I get the error
__ERROR_START__
Technical Information (for support personnel)
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/MusicStore/addrecord.asp, line 53
__ERROR_END__
If I run the sabe sql statement on "query analyser" of access, it works
ok (the record is inserted).
What can be the problem? any ideas?
Than you very much
Sérgio Almeida