Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 3rd, 2004, 01:20 PM
Registered User
 
Join Date: Oct 2004
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access Databases won't update through code

Unable to AddNew or SQL insert to add records to Access database. Seems to occur with any database even when I try the samples like Northwind and borrowed code. Have been over and over database setup to insure it is not read only. Contacted a MS support professional who thought it was the browser scripting security, but changing didn't seem to help.

Error Message
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.

This occurs at the AddNew line in the following code:

<% @Language = VBScript %>
<% Option Explicit %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<!--METADATA TYPE="typelib"
             FILE="C:\Program Files\Common Files\System\ado\msado15.dll"-->
<html>
<head>
    <title>Process HR Admin</title>
</head>
<body>

<%
'Need to figure out why this recordset is read-only


Dim strCoID, intCoID
strCoID = Request.form("CoID")
intCoID = CInt(strCoID)
Response.Write intCoID

Dim objConnect
Set objConnect = Server.CreateObject("ADODB.Connection")
Dim strConnect
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\SRRMkt\Mkt.mdb;Persist Security Info=False"


Dim objRS
Set objRS = Server.CreateObject ("ADODB.Recordset")
objRS.Open "HR1", strConnect, adOpenKeyset, adLockOptimistic, adCmdTable
'objRS.MoveLast
objRS.AddNew
'objRS("CoID") = intCoID
objRS.Update
objRS.Close
Set objRS = Nothing
objConnect.Close
Set objConnect = Nothing


%>


</body>
</html>



Reply With Quote
  #2 (permalink)  
Old October 3rd, 2004, 02:27 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

This could be caused by incorrect security permissions. The account the Web server runs under (by default, IUSR_MachineName for a server wit IIS), needs permissions to write to the folder that contains the database.

Check out this FAQ for more info:

http://Imar.Spaanjaars.Com/QuickDocID.aspx?CONTENT=290

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old October 3rd, 2004, 03:33 PM
Registered User
 
Join Date: Oct 2004
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Worked like a charm thanks much.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for Beginning databases with MYSQL sponsora MySQL 3 July 18th, 2008 06:24 AM
UpDATE IN VB FROM TWO DATABASES akash VB How-To 5 April 20th, 2005 03:44 AM
Where is the code of Beginning C# Databases? jiche All Other Wrox Books 3 April 15th, 2005 07:56 AM
Professional XML Databases - Where's the code? MizTaken All Other Wrox Books 2 March 18th, 2005 02:01 AM
Update two databases at the same time Arsi SQL Server 2000 10 November 18th, 2004 06:38 PM



All times are GMT -4. The time now is 11:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.