Unable to update database when testing code locall

Results 1 to 2 of 2

Thread: Unable to update database when testing code locall

  1. #1
    Join Date
    Dec 1969

    Default Unable to update database when testing code locall

    Hi all,<BR><BR>I have written a piece of code to write the data from a form into a access database. The code is shown below.<BR><BR><BR>&#060;!--#include file="ADOvbs.inc"--&#062;<BR>&#060;%<BR>Dim oRS<BR>Set oRS=Server.CreateObject("ADODB.Recordset")<BR>oRS. Open "tblpatientdetails","DSN=patientdetails",adOpenKey set,adLockOptimistic<BR>oRS.AddNew <BR>ORS.Fields("Lname")=Request.Form("lname")<BR>O RS.Fields("Fname")=Request.Form("fname")<BR>ORS.Fi elds("Minitial")=Request.Form("minitial")<BR>ORS.F ields("Mrecno")=Request.Form("mrecno")<BR>ORS.Fiel ds("Age")=(CInt(Request.Form("age")))<BR>ORS.Field s("Sex")=Request.Form("sex")<BR>ORS.Fields("Dob")= Request.Form("dob")<BR>ORS.Fields("Exam_date")=Req uest.Form("examdate")<BR>ORS.Fields("Exam_type")=R equest.Form("examtype")<BR>ORS.Fields("Eqptmodel") =Request.Form("eqptmodel")<BR>ORS.Fields("Reasonfo rdiag")=Request.Form("reasonfordiag")<BR>ORS.Field s("Diffdiag")=Request.Form("diffdiag")<BR>ORS.Fiel ds("Icd9")=Request.Form("icd9")<BR>ORS.Fields("Mjr find")=Request.Form("mjrfind")<BR>ORS.Fields("Mnrf ind")=Request.Form("mnrfind")<BR>ORS.Fields("Techn ote")=Request.Form("technote")<BR>ORS.Fields("Qc") =Request.Form("qc")<BR>ORS.Fields("Followup")=Requ est.Form("followup")<BR>ORS.Update<BR>oRS.close<BR >%&#062;<BR><BR>When I try to call this asp page writetodb.asp I get the following error.<BR><BR>Microsoft OLE DB Provider for ODBC Drivers (0x80004005) <BR>[Microsoft][ODBC Microsoft Access Driver] Cannot Update<BR>Database or Object is read-only<BR><BR>/writetodb.asp, line 25<BR><BR>I see that the error may be due to access file being read only, but I double checked it. I have have no problems there. I&#039;m testing the code on a computer running XP Professinal and I have IIS 5.1 installed. I also find that the inetpub folder is readonly and I&#039;m unable to uncheck the readonly option. <BR><BR><BR>The code works perfectly fine on a computer running Windows 2K SP 3 with IIS 5.0 installed. <BR><BR>Please help<BR><BR>Thanks <BR><BR>Senthil

  2. #2
    Join Date
    Dec 1969

    Default Who has access to the file.

    You said you double checked but who do you have access granted to?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts