Check location of current db to ensure it is not a copy

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a split database that will be distributed across various network
drives in my company.
I will be updating the data in one of the tables in the backend db once a
month.
To ensure that a user hasn't taken a copy of the db and moved it elsewhere
(and therefore bypassing any monthly update), how can I check that the
database being used is in a location I allow?

I thought of having a list of file paths(these need to be UNC paths) on a
table on the backend db, and then running some code at startup to get the
current location of the db and matching it to one of the records in the
table. If it exists, the db can open, if it doesn't then the db won't open.

Has anyone done this before and has some code? I'm not a VB coder, so have
no idea how to put my theory into reality.

Thanks
Jamie
 
Niceaction said:
I have a split database that will be distributed across various network
drives in my company.
I will be updating the data in one of the tables in the backend db once a
month.
To ensure that a user hasn't taken a copy of the db and moved it elsewhere
(and therefore bypassing any monthly update), how can I check that the
database being used is in a location I allow?

I thought of having a list of file paths(these need to be UNC paths) on a
table on the backend db, and then running some code at startup to get the
current location of the db and matching it to one of the records in the
table. If it exists, the db can open, if it doesn't then the db won't
open.

Has anyone done this before and has some code? I'm not a VB coder, so
have
no idea how to put my theory into reality.

Thanks
Jamie


To see the path of the current MDB (the application MDB in a split design)
....

Debug.Print CurrentProject.Path

To see the path of the data MDB, examine the Connect property of one of your
linked tables ..

Debug.Print Mid$(CurrentDb.TableDefs("Students").Connect, 11)

To demonstrate the reason for the "11" in the above example, take a look at
the result of this ...

Debug.Print CurrentDb.TableDefs("Students").Connect

Just change "Students" in the example to the name of one of your linked
tables.
 
Back
Top