Front-end back-end

  • Thread starter Thread starter Luciano
  • Start date Start date
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?
 
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
 
Set tbRegios = db.OpenRecordset("tblRegios", DB_OPEN_TABLE)

change the above to:

Set tbRegios = db.OpenRecordset("tblRegios")
 
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....
 
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).
 
Back
Top