Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Read Only error when trying to write to Access DB

Reply
Thread Tools

Read Only error when trying to write to Access DB

 
 
Stephen D Cook
Guest
Posts: n/a
 
      12-14-2007
I am trying to write to an ACCESS database. I have full permission and
Read/Write capability set for the database and folder. But when I get
to MoveLast or Update, I get an error of the database is ReadOnly. I
can open the database and add new lines, modify and delete with no
problems, but when I run this code-behind code, I get the ReadOnly
error. Please help.

Dim objConn
objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=DCTRepair"
objConn.Open()
Dim objRS
objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open("TechEntry", objConn, 2, 3, 2)
objRS.AddNew()
objRS("SerialNumber") = TextBox1.Text
objRS("TechNumber") = TextBox2.Text
'objRS.MoveLast()

objRS.Update()
objRS.MoveFirst()

objConn.Close()
objConn = Nothing
End Sub

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      12-14-2007
Stephen D Cook wrote:
> I am trying to write to an ACCESS database. I have full permission and
> Read/Write capability set for the database and folder. But when I get
> to MoveLast or Update, I get an error of the database is ReadOnly. I
> can open the database and add new lines, modify and delete with no
> problems, but when I run this code-behind code, I get the ReadOnly
> error. Please help.
>
> Dim objConn
> objConn = Server.CreateObject("ADODB.Connection")
> objConn.ConnectionString = "DSN=DCTRepair"
> objConn.Open()
> Dim objRS
> objRS = Server.CreateObject("ADODB.Recordset")
> objRS.Open("TechEntry", objConn, 2, 3, 2)
> objRS.AddNew()
> objRS("SerialNumber") = TextBox1.Text
> objRS("TechNumber") = TextBox2.Text
> 'objRS.MoveLast()
>
> objRS.Update()
> objRS.MoveFirst()
>
> objConn.Close()
> objConn = Nothing
> End Sub


This is ALWAYS due to file permissions problems. You say "I" have full
permissions: does the IUSE_machinename account have those permissions?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      12-14-2007
Bob Barrows [MVP] wrote:
>
> This is ALWAYS due to file permissions problems. You say "I" have full
> permissions: does the IUSE_machinename account have those permissions?
>

This should be IUSR, of course, not IUSE.
Sometimes the IWAM_machinename account needs rights as well, depending
on where the code is running and what your isolation setting is in IIS.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read only and / or write only class members A C++ 1 11-03-2010 07:36 PM
want to replace a read only cd transport with read / write transport larya Computer Support 7 09-11-2006 10:21 PM
Database file and folder are not read only but error message says it is read only?? keithb ASP .Net 2 06-07-2006 03:40 PM
How to know if a method is read-write or read-only Trans Ruby 3 12-21-2005 12:21 AM
Re: How to change Read Only Constraint to Read-Write Isaac VHDL 0 07-10-2003 01:43 PM



Advertisments