Welcome to SPN

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

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95
      Become a Supporter    ::   Make a Contribution   

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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page