Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Recordset adLockReadOnly but still "currently locked by another user"!

Discussion in 'Information Technology' started by Arnaud Lesauvage, Jul 28, 2006.

  1. Arnaud Lesauvage

    Arnaud Lesauvage
    Expand Collapse
    Guest

    Hello groups !

    In a vbs script, I connect to an Access 2000 database and open a
    recordset for in readonly mode :

    Dim oConn
    Dim oRS
    Set oConn = CreateObject("ADODB.Connection")
    Set oRS= CreateObject("ADODB.RecordSet")

    oConn.Provider = "Microsoft.Jet.OLEDB.4.0"
    oConn.Open "Data Source=M:\mydb.mdb;User
    ID=myuser;Password=mypassword;Persist Security Info=True;Jet
    OLEDB:System database=M:\systemdb.mdw"

    oRS.Open "Select Count(*) FROM mytable WHERE
    somefield='somevalue'", oConn, adOpenForwardOnly, adLockReadOnly

    On this last line, I get an error 80004005 : "Could not save;
    currently locked by another user".

    I know that another user might be accessing the database at this
    moment, but I just want a count in readonly mode, why do I have
    this message about "could not save" ?


    Thanks for your help !

    Regards
    --
    Arnaud
     
  2. Arnaud Lesauvage

    Arnaud Lesauvage
    Expand Collapse
    Guest

    Re: Recordset adLockReadOnly but still "currently locked by anotheruser" !

    Arnaud Lesauvage wrote:
    > oRS.Open "Select Count(*) FROM mytable WHERE
    > somefield='somevalue'", oConn, adOpenForwardOnly, adLockReadOnly
    >
    > On this last line, I get an error 80004005 : "Could not save;
    > currently locked by another user".



    It must be a pretty common error. Anybody has a clue ?

    Regards
    --
    Arnaud
     

Share This Page