Couldn't you carry the uid and pwd as a variable and then
pass it each time in the connection string?
This would be similar to holding it as a session variable
on a web site.
-----Original Message-----
In my workbooks I often use one sheet to contain multiple
database
queries from separate tables for lists of Department
Id's, Account
Numbers, Project Id's, etc. I then assign names to the
ranges and then
use these named ranges in validated cells. For each of
the queries I set
the data range properties to refresh data on file open.
My problem is that I need to have the user who opens the
file enter
their name and password so the lists are validated using
the database
security to display only the Id's they are allowed to
view and use. I
can set the data range properties to not save the
password, however, if
there are multiple queries they are forced to re-enter
their name and
password once for each query.
Using VBA, can I request a username and password, with
the password
displayed as *** as they type it in, then apply this into
each query as
I refresh them using VBA rather than refreshing the data
on file open?
I would set this procedure to run in my Workbook_open()
sub
Simon Shaw, CA
Parnter
AccountTech
www.accounttech.ca
*** Sent via Developersdex http://www.developersdex.com
***
Don't just participate in USENET...get rewarded for it!
.