Reply
Adding to an access database
Old 04-16-2004, 06:56 AM Adding to an access database
Junior Talker

Posts: 3
Hey all,
i have an assignment at tafe where we have to create a booking system for an online tour company. I'm having major problems with adding new customers to the database. I'm getting an error that says :
Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/assignment/pages/confRego.asp, line 34
Line 34 is where my rs.Addnew is

I'm not sure why this is happening and my teacher is on holidays!!

here's the jist of what i've got in my code

rs.MoveLast
rs.AddNew

rs("fieldname") = Request.Form("fieldname")

rs.Update
rs.Close
then i set the rs to nothing and close and set the connection to nothing.

Am i missing something? My sql is just "SELECT * FROM customers"

I'm using an Access database too. If anyone can help i would much appreciated
meex is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 04-17-2004, 02:31 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
You need to make sure that your database (.mdb file) and the folder that it's in has write permissions.
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Old 04-19-2004, 12:05 PM
D.Viddy's Avatar
Average Talker

Posts: 24
Location: Soldotna, Alaska
Make sure that when you open the recordset, you are using the correct locktype and cursor. This can sometimes effect the features provided by a database connection. If none of this helps, double check the permissions on the folder the database resides in. If all of that fails then try to add your new record with SQL. This looks a little something like this.

Set adoCon = Server.CreateObject("ADODB.Connection")

adoCon.Open "DBConnection"

strSQL = "INSERT INTO TableName (column1, column2) VALUES ('col1value', 'col2value');"

adoCon.Execute strSQL

adoCon.Close

Set adoCon = Nothing

Give that a try. Hope this helps.
__________________
-Dylan Vester
D.Viddy is offline
Reply With Quote
View Public Profile Visit D.Viddy's homepage!
 
Reply     « Reply to Adding to an access database
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11275 seconds with 13 queries