Results 1 to 6 of 6

Thread: DAO database locked

  1. #1

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    I'm using VBA with DAO to open a recordset from an Access table. This all works fine.

    The problem comes when I attempt to overwrite the old table with a new one. I get a "database locked" error, ostensibly because someone else on the floor is using it.

    I have tried using DBEngine.Idle dbFreeLocks,
    but this didn't help.

    How can I provide read-only access to the table so the recordset can be produced, without locking the table? Thanks for any suggestions.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Have you tried defining your recordset as a snapshot like the following?
    Code:
    Dim ssWorldFeatures As Snapshot
        
        Set ssWorldFeatures = gdbRWTS.CreateSnapshot("Select * From WorldFeatures order by ID")

    ------------------
    Marty

  3. #3

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    Originally I was opening it as "dbOpenSnapshot". Is this the same thing?

    I used CreateSnapshot, and got this error:

    Compile Error:
    Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic.

    [This message has been edited by billwagnon (edited 01-03-2000).]

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    It should be the same thing. You got an error because we are using different versions of DAO.

    ------------------
    Marty

  5. #5

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    How can I change the version?

  6. #6
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Update VB5 to VB6 or apply the latest SR to what you have.

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