Front-end back-end

L

Luciano

Hi,
I have an Access -application that runs with not-linked tables. I wish to
have a bac-end front-end use of my database.
I have written some code to open my local tables, something like
Set ws = DBEngine.Workspaces(0)
Set db = DBEngine.Workspaces(0).Databases(0)
Set tbRegios = db.OpenRecordset("tblRegios", DB_OPEN_TABLE)
I created a back-end database containing all my linked tables (with the
Split-Wizard). How may I modify my VBA-code to approach these tables?
 
J

Jeanette Cunningham

Luciano,
You don't need the code below.
Create a link to the tables in the backend like this:
In the frontend do File | Get External Data | Link Tables
navigate to the backend and select the tables.
That's there is all to setting up the link.

Jeanette Cunningham
 
A

Albert D. Kallal

Set tbRegios = db.OpenRecordset("tblRegios", DB_OPEN_TABLE)

change the above to:

Set tbRegios = db.OpenRecordset("tblRegios")
 
A

Albert D. Kallal

Albert D. Kallal said:
Set tbRegios = db.OpenRecordset("tblRegios", DB_OPEN_TABLE)

also, likely better (and you could use the global search/replace) is to
change the above to:
Set tbRegios = db.OpenRecordset("tblRegios", dbOpenDynaset)

The failure is occurring because you can't open a linked tables as "table"

I for the most part just use:

Set tbRegios = db.OpenRecordset("tblRegios")

Access will open this as db-table if local, or dynaset if linked for you.
This means you don't have to change your code for linked vs non linked
tables....
 
J

John W. Vinson

Access will open this as db-table if local, or dynaset if linked for you.
This means you don't have to change your code for linked vs non linked
tables....

well, unless you use the SEEK method, which works on Table datasets but not
Dynasets. One reason I never use the SEEK method (fortunately for me, the
FindFirst method has always given adequate performance).
 

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

Similar Threads


Top