When table pointed to is changed...

  • Thread starter Thread starter Razor
  • Start date Start date
R

Razor

Hi,

I have a link to a table in a different db.

When I replace the table that the link points to in the
backend database:

1. What date changes in the pointer to the table?
(Modified? Created?)
In order to phrase my question, I'll refer to this date as
ReplaceDate()
2. Can I use/access this date in a query on the linked
table?
I want to return records where:
ReplaceDate() minus [Somefield] <=60

If no date gets updated when the table that is pointed to
gets replaced, I guess I could use
Now()-[Somefield]<=60

but I really want to base it off the date the table is
replaced.

Thanks,
Razor
 
Razor-

The LastUpdated property of the linked table definition in your local
database won't change unless you rebuild the TableDef or do a RefreshLink -
but that won't tell you the last update of the back end table. You would
have to open the back end directly and examine the TableDef object of the
source table. Even then, the LastUpdated property is often not reliable.
For example, LastUpdated sometimes gets updated when you do a compact! Use
the OpenDatabase method of the current Workspace to open the other database
directly in code.

Dim db As DAO.Database, ws As DAO.Workspace, tdf As DAO.TableDef
Set ws = DBEngine(0)
Set db = ws.OpenDatabase("Z:\Back End DBs\MyDatabase.mdb")
Set tdf = db.Tabledefs("BackEndTable")
If tdf.LastUpdated ...

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top