Table Link

S

Simon

I've been using TableLink.mdb (by Strive4Peace) in my application for 2 years
now and its great!
I would however, now like to password protect the db I'm linking to.
A new db is written each week and the users re-link to the latest one.
Each new db will have the same password.
The password could be stored in the code as the main app is distributed as
mde.
I can't just re-link to the password protected db manually (saving the
password) because the name of the db I'm linking to changes each week.
Any ideas?
Thanks
 
S

strive4peace

Hi Simon,

Glad you are finding my linking code useful. I have some things to do
now but will look at this later and tell you how you can achieve your goal.

meanwhile, do this:

1. press Ctrl-G to Goto the debuG (Immediate) window
2. type:
? currentdb.TableDefs("YourTablename").Connect
and press ENTER

Paste the result back into a post to this thread. You can change the
password parameter to

Password=xxxxx



Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
S

Simon

Thank you for your help. Here it is,

MS Access;PWD=xxxxx;DATABASE=D:\Documents and Settings\Simon\Desktop\Price
Data\2008.09.26.mdb

Simon
 
S

strive4peace

Hi Simon,

will the new database be in the same directory?

will there be just ONE mdb in the directory or will you need to ask the
user what it is called?

if there will be just one database, you can find the name with DIR

dim strFilename as string
strFilename = DIR("D:\Documents and Settings\Simon\Desktop\*.mdb")


if the user needs to be prompted for either filename or location, here
is a link to show how to do that:

API: Call the standard Windows File Open/Save dialog box
http://www.mvps.org/access/api/api0001.htm

~~~

then, what is left is to construct the proper Connect string. It is
best to actually delete the existing linked table and create a new one

no username in the connect string?

do you start to see what needs to be done?

how many tables are linked to this database?

does your database use just one back-end (BE) or do you have tables
linked to another BE as well?


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
S

Simon

Hi Crystal,
No the db is in a different directory and already uses Ken Getz code to open
dialog box allowing the user to navigate to the mdb.
There are multiple mdb.s in this folder.
There are no usernames in the connect string.
There are 10 tables in the mdb I am linking to and and a local table in my
FE called Syslinks which lists them by name.
There are 3 BE,s in total.
Thanks again,
 
S

strive4peace

Hi Somon,

does your Syslinks table identify which tables are in which BE's? What
are the fieldnames in the Syslinks table?


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
S

Simon

Hi Crystal,
The Syslinks table just contains the table names.
I only use your Table Link to enable users to link to a pricing update BE.
So they select the latest price data mdb and your app links just the pricing
tables (ie those named in the Syslinks table).
Thanks again for your time.
 

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