Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting records into MS Access Database

Status
Not open for further replies.

essdee

Programmer
Nov 28, 2002
11
IN
HI all,
The problem that i am facing is that when I try to insert records into MS Access Database from my ASP page.
I have written the following code:

set DB = server.createobject("ADODB.Connection")
DB.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.mappath(db1.mdb)"

set rs = server.createobject("ADODB.Recordset")
rs.open "select * from orderTab",db,adOpenDynamic,adLockOptimistic

rs.addnew '''this is the line which gives Error

The error is Cannot update as the object is readonly or the locktype does not support Updates..

I have tried to change the cursortype but even then it does not work. The Database is not readonly. I have also checked the permissions on the Virtual Directory, it has read, write and execute permissions.


Please Help
 
why not use the plain old insert stmt?

sql="insert into table(Columnname1,Columnname2...) values('"&vl1&"','"&vl1&"'....)"

db.execute sql

Known is handfull, Unknown is worldfull
 
I tried using the simple insert statement that you have given, When that is used I get an error message

The query needs an updatable recordset!


So i went for the other method of inserting records

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top