470,841 Members | 948 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,841 developers. It's quick & easy.

problems adding record to access database

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

Jul 19 '05 #1
1 1704
www.aspfaq.com/5003

Ray at work

"Sérgio Almeida" <sg*************@bragatelNOSPAM.pt> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
Greetings

I'm having problems adding records to an access database.
What I want to do is very simple. Here is my code.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jim Heavey | last post: by
13 posts views Thread by Lars Netzel | last post: by
4 posts views Thread by jg1130 | last post: by
6 posts views Thread by Michael Kintner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.