Using ADO Datashaping in Access

P

Paul

Hi,

I'm experimenting (or trying to) with ADO data shaping from *within* MS
Access but can't seem to get the connection sorted.

As I understand it I need to do something like:

Dim conn As New ADODB.Connection
conn.Provider = "MSDataShape"
conn.Open "Data Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\Development\MyDB.mdb"

However, the third line (conn.open) always fails reporting "The database has
been placed in a state by a user 'X' on machine 'Y' that prevents it from
being opened or locked"

If I leave the third line out and try to open the recordset, e.g.

rs.Open "Shape {Select..." , CurrentProject.Connection

Then the connection is not using the correct provider and the Shape command
is not recognised.

How do I set the provider to MSDataShape while still managing to open a
connection (or use the existing open connection) to the Access database?

Thanks
 
P

Paul

Doh!

I got the conn wrong once, then fogot to close it - never mind - I have it
working now. Thanks anyway.
 

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