Results 1 to 3 of 3

Thread: Can't get around error message.

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Location
    London, UK.
    Posts
    14

    Angry Can't get around error message.

    Dear Folks,

    I have been running the exact ASP code on three machines; one with Windows NT and the other two with Windows 98/ME. All have MS Personnal Web Server installed.

    The main part of the code, which opens a database connection and then using this opens a recordset object, is as follows:



    <!-- METADATA TYPE="typelib"
    FILE="c:\Program Files\Common Files\System\ado\msado15.dll" -->

    Dim objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
    "Data Source= C:\Inetpub\wwwroot\class\ch15\classified_2000.mdb"

    Dim rsUsers
    Set rsUsers = Server.CreateObject("ADODB.Recordset")
    rsUsers.Open "Person", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable

    If Session("PersonID") <> "" Then ' currently logged-on user
    rsUsers.Filter = "PersonID = '" & Session("PersonID") & "'"
    Else ' New session
    rsUsers.Filter = "EMailAddress = '" & Request.Form("email") & "'" & _
    "AND Password = '" & Request.Form("password") & "'"
    If rsUsers.EOF Then ' User not found
    rsUsers.AddNew ' ...so add a new record



    Now what happens is that on the Win 98/ME machines everything works fine... a new record is added as required and the next page comes up. However, with the NT one, the following error message comes up in the IE browser:


    Error: 80040e09
    Can not update. Database or object is read only.

    And it points to the line 'rsUsers.Addnew' as the cause.


    I don't know why this is happening. Could it be related to the version of ADO/DAC on the machine or maybe the version of the msado15.dll file? or something else?

    CAN ANYONE HELP?!

    Asif.

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    You are opening the recordset as read only.

    change this:
    rsUsers.Open "Person", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
    to this:
    rsUsers.Open "Person", objConn, adOpenKeyset, adLockOptimistic, adCmdTable
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Location
    London, UK.
    Posts
    14

    Still not working....

    Hi monte96......

    It didn't work!

    What else could it be?

    asif.

Posting Permissions

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



Click Here to Expand Forum to Full Width