Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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

Posts: 3
Trades: 0
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
 
 
Register now for full access!
Old 04-17-2004, 03:31 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
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
 
Old 04-19-2004, 01:05 PM
D.Viddy's Avatar
Average Talker

Posts: 24
Location: Soldotna, Alaska
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.29021 seconds with 12 queries