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)

Re: Word 2000: DAO OpenRecordset error by Alex

Alex
Tue Jan 27 11:00:02 CST 2004

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

Alex.

"VBA Coder" <noone@account.com.NO_SPAM.> wrote in message
news:uN0Pn1O5DHA.2344@TK2MSFTNGP09.phx.gbl...
> 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)
>
>



Re: Word 2000: DAO OpenRecordset error by Perry

Perry
Tue Jan 27 11:03:37 CST 2004

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

"VBA Coder" <noone@account.com.NO_SPAM.> wrote in message
news:uN0Pn1O5DHA.2344@TK2MSFTNGP09.phx.gbl...
> 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)
>
>