ASP and ADO

Error: Database or Object Readonly

Page 1 of 1

3 Replies - 532 Views - Last Post: 05 September 2009 - 06:16 PM Rate Topic: -----

#1 programmer2u  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 17
  • Joined: 01-May 09

ASP and ADO

Posted 04 September 2009 - 06:18 PM

Hi,
I am getting error of ASP with ADO. I also tried Insert command.
Please help me .

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<% @ Language=VBScript %>
<% 'option explicit
Response.Expires=0 %>
<!-- #include file="adovbs.inc"-->
<html>

<head>
  <title></title>
  
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">


<% dim con,rec
Set con=server.CreateObject("ADODB.Connection") 
con.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("login.mdb")

Response.Write("</br>connection opened")
Response.Write("<HR>")
set rec=server.CreateObject("ADODB.Recordset")

 rec.CursorLocation=adUseServer
 rec.CursorType=adOpenKeyset
 rec.LockType=adLockOptimistic
 
rec.open "log",con,,,adCmdTable


rec.AddNew '<-------------error occur here(see below the description of error)

rec("name")="rd"
rec("pass")="check"

rec.Update


RESPONSE.WRITE("<HR/>")
'****************************************************************************************

response.write("<hr/>")


response.write("connection closed")'<---check this

rec.Close
con.close
set con=nothing
 
%>
</body>
</html>
********************************************************




Description of error:
Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/myweb/log/ins.asp, line 34
Browser Type:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.43 Safari/530.5
Page:
GET /myweb/log/ins.asp
Time:
Friday, September 04, 2009, 9:41:47 PM
More information:
Microsoft Support

Is This A Good Question/Topic? 0
  • +

Replies To: ASP and ADO

#2 Glorfindal  Icon User is offline

  • Java Enthusiast
  • member icon

Reputation: 23
  • View blog
  • Posts: 535
  • Joined: 31-December 08

Re: ASP and ADO

Posted 04 September 2009 - 08:20 PM

Have u looked to see if teh database is read-only?
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1632
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: ASP and ADO

Posted 05 September 2009 - 11:23 AM

First thing to look at is what lock type are you opening the RecordSet with? needs to be adLockOptimistic or adLockPessimistic. Take a look at this for more information :)
Was This Post Helpful? 0
  • +
  • -

#4 programmer2u  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 17
  • Joined: 01-May 09

Re: ASP and ADO

Posted 05 September 2009 - 06:16 PM

Well Psycocoder..thanks for replying.
but i already done with ADO constants... like adlockoptimistic and adopenkeyset


but still i am getting same problem. I check the MsAccess data base properties.
not set for readonly.


still error exists..

I already posted the code i am using ...i realy struk with this error please help!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1