ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 16th, 2003, 11:24 PM
hazh hazh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 hazh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cannot Add/Update Access database

I got problem to insert or update new record into the Access database. For your information, I run my ASP program on Win XP Professional SP1(service pack 1)with IIS 5.1 and ASP.NET v1.1. I''m using Access database version 2002.

I can read the database file, but can''t add new record to it although I was set the folder which database files reside to permissioan access to be write in IIS. My ASP program(program to add new record with ASP) work fine with other pc but got an errors with my pc.

The errors stated in my web browser as below:-

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

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/testinsertasp.asp, line 77


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

This is my ASP program to insert new record into the Access database:-

<!--METADATA TYPE="typelib" FILE="c:\program files\common files\system\ado\msado15.dll"-->
<%
Option Explicit

Call Main

Sub Main
if request("a") = "v" Then
Call AddRecord
else
Call Showform
end if
End Sub

Sub Showform
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>

<form name="form1" method="post" action="<%=request("script_name")%>?a=v">
<div id="Layer1" style="position:absolute; left:156px; top:64px; width:88px; height:20px; z-index:1">Name</div>
<div id="Layer2" style="position:absolute; left:281px; top:57px; width:236px; height:23px; z-index:2">
<input name="txtname" type="text" id="txtname">
</div>
<div id="Layer3" style="position:absolute; left:151px; top:108px; width:101px; height:19px; z-index:3">IC</div>
<div id="Layer4" style="position:absolute; left:280px; top:107px; width:234px; height:19px; z-index:4">
<input name="txtic" type="text" id="txtic">
test new</div>
<div id="Layer5" style="position:absolute; left:149px; top:153px; width:102px; height:15px; z-index:5">Address</div>
<div id="Layer6" style="position:absolute; left:280px; top:145px; width:234px; height:22px; z-index:6">

<textarea name="txtadd" id="txtadd"></textarea>

</div>
<div id="Layer7" style="position:absolute; left:282px; top:243px; width:56px; height:26px; z-index:7">
<input type="submit" name="Submit" value="Submit">
</div>
<div id="Layer8" style="position:absolute; left:377px; top:244px; width:67px; height:23px; z-index:8">
<input type="submit" name="Submit2" value="Clear">
</div>
</form>

</body>
</html>
<% End Sub %>

<% Sub AddRecord

Dim rs,conn,strname,stric,stradd
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= " & server.MapPath("database/test.mdb")
conn.Open

strname = trim(request.form("txtname"))
stric = trim(request.form("txtic"))
stradd = trim(request.form("txtadd"))

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT * FROM tblPersonal", conn, adOpenDynamic, adLockOptimistic
'On error resume next

rs.Addnew
rs("Name") = strname
rs("IC") = stric
rs("Add") = stradd
rs.Update
rs.Movelast

rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
'if err <> 0 Then
'Response.write "Data fail to be write"
'else
'Response.write "Success"
'end if

End Sub %>

I think maybe got some problem with my IIS 5.1, ASP.NET v1.1 and Win XP Professional.

Your help is much appreciated.

Thank you.

Reply With Quote
  #2  
Old December 17th, 2003, 03:24 PM
Doug G Doug G is online now
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,257 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 18 h 51 m 19 sec
Reputation Power: 4445
Moved to ASP from the IIS forum

Reply With Quote
  #3  
Old January 7th, 2004, 01:19 PM
techwreck techwreck is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 14 techwreck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 11 sec
Reputation Power: 0
I am having the exact same problem.

I am using XP Pro, Access 2003, ASP, IIS 5.1 on Personal Web Server with file type of NTFS.

I adjusted the database in IIS management to Write. When I go to the folder in Windows Exploder to adjust the folder to Write, when I apply and get out, I go back to the properties and the folder is Read again.

This is the error message I am getting in ASP:

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/TestSite/ValidateLogin.asp, line 59


Any help would be very appreciated.

Reply With Quote
  #4  
Old January 7th, 2004, 04:20 PM
Doug G Doug G is online now
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,257 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 18 h 51 m 19 sec
Reputation Power: 4445
Is the MDB file marked as "read-only"?

Reply With Quote
  #5  
Old January 7th, 2004, 05:29 PM
techwreck techwreck is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 14 techwreck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 11 sec
Reputation Power: 0
No, the database itself is not marked as "Read-only".

However, the folder 'databases' seems to remain 'Read-only', everytime I change that folder to Write, after I 'Apply' and 'OK'. If I check the properties again, it has a slight green box on "Read-only" not a check???

???

Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Cannot Add/Update Access database

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap