PDA

Click to See Complete Forum and Search --> : DAO database locked


billwagnon
Jan 3rd, 2000, 04:38 AM
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.

MartinLiss
Jan 3rd, 2000, 05:36 AM
Have you tried defining your recordset as a snapshot like the following?Dim ssWorldFeatures As Snapshot

Set ssWorldFeatures = gdbRWTS.CreateSnapshot("Select * From WorldFeatures order by ID")


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

billwagnon
Jan 3rd, 2000, 05:39 AM
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).]

MartinLiss
Jan 3rd, 2000, 06:31 AM
It should be the same thing. You got an error because we are using different versions of DAO.

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

billwagnon
Jan 3rd, 2000, 11:53 AM
How can I change the version?

JHausmann
Jan 5th, 2000, 01:37 AM
Update VB5 to VB6 or apply the latest SR to what you have.