Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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>



 
Old October 3rd, 2004, 02:27 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.
 
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.





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.