Word 2000: DAO OpenRecordset error

V

VBA Coder

In Word 2000 using DAO 3.6:

I am getting the following error

"Visual Basic Runtime error '3008': The table 'Test' is already opened
exclusively by another user, or it is already open through the user
interface and cannot be manipulated programmatically"

when I try to open my recordset object against a table in an Access database
where the table is open in the Access Database (MDB) in design mode. I do
not get the error if the table is open showing all the records - only if it
is open in Design mode.

Does anyone know if it is possible to run a SQL statement to return records
against a table that is open in Design Mode?

The following code is being executed against a table in an Access database
that is open in Design mode:

It fails on the OpenRecordset line:

Dim wrkJet As DAO.Workspace
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim sSQL As String

Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set db = wrkJet.OpenDatabase("C:\Test.mdb", , True)
sSQL = "SELECT * FROM test"
Set rst = db.OpenRecordset(sSQL, dbOpenDynaset, dbReadOnly)
 
A

Alex Ivanov

No.
In this case the table is opened exclusively, just as the error message
says.

Alex.
 
P

Perry

When an Access table is open in design mode,
JET locks the table from being updated.

If wudn't lock the table, what if
- fields are added
or
- field datatypes are adjusted.

As result of which, you can't open a recordset off a table
opened in design mode.

Sounds logical, not?

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top