How to save ADP connection UserID/Password on exit.

Z

ZRexRider

Hi,

I have an MS-Access 2002 ADP application that gets deployed to a large
group of people. Most of these users are able to use a "trusted
connection" but there are a dozen or so that are situated on a
domain/setup that will not allow "trusted".

Anyway, I have VBA setting the connection string based on the domain
used to connect. I deploy the application set up for trusted
connection. I have no issues with the trusted connection - works just
great.

However, using userid/password I have two issues:

1. I would rather the ADP file wouldn't try to connect to the database
at all on its own (during startup). I'd rather it let my VBA code do
that. As it stands today, since it's deployed as trusted it has a
delayed startup on first use since ADP trys to connect using trusted,
fails (quietly) and then my VBA builds the "real" connection and lets
the user in. I've been googling and it sounds like there is no way to
disable the ADP built in connection attempt. If someone knows
otherwise...

2. Since one of the objectives is to not prompt the user for "yet
another password" they asked me to use the same password for each user
for non-trusted members. So my code grabs their Userid from
Environ("Username"), pair it up with this common password and log them
in. However, the next time they open the application ADP prompts them
for the userid and password before it runs my VBA code. Is there a way
to save this info in the ADP so it stops pestering the user? There is
an option on the Data Link Properties panel (off the File|Connection
menu but I plan to never expose the user to that menu.

Thanks
so it doesn't prompt the user on start up. When the user runs it for
the first time the built in
 
B

Baz

ZRexRider said:
Hi,

I have an MS-Access 2002 ADP application that gets deployed to a large
group of people. Most of these users are able to use a "trusted
connection" but there are a dozen or so that are situated on a
domain/setup that will not allow "trusted".

Anyway, I have VBA setting the connection string based on the domain
used to connect. I deploy the application set up for trusted
connection. I have no issues with the trusted connection - works just
great.

However, using userid/password I have two issues:

1. I would rather the ADP file wouldn't try to connect to the database
at all on its own (during startup). I'd rather it let my VBA code do
that. As it stands today, since it's deployed as trusted it has a
delayed startup on first use since ADP trys to connect using trusted,
fails (quietly) and then my VBA builds the "real" connection and lets
the user in. I've been googling and it sounds like there is no way to
disable the ADP built in connection attempt. If someone knows
otherwise...

Actually there is a way to do it. If you run the following statement before
you close the project, it will clear the connection information and next
time it will open disconnected:

CurrentProject.OpenConnection ""

I also have projects where my startup code sorts out the connection, and I
simply run the above statement in the debug window before I deploy the
project.
2. Since one of the objectives is to not prompt the user for "yet
another password" they asked me to use the same password for each user
for non-trusted members. So my code grabs their Userid from
Environ("Username"), pair it up with this common password and log them
in. However, the next time they open the application ADP prompts them
for the userid and password before it runs my VBA code. Is there a way
to save this info in the ADP so it stops pestering the user? There is
an option on the Data Link Properties panel (off the File|Connection
menu but I plan to never expose the user to that menu.

Thanks
so it doesn't prompt the user on start up. When the user runs it for
the first time the built in

The smart way to run an ADP (or indeed an mdb front-end for that matter) is
to launch it from a vb script which first creates a new local copy of the
ADP from a clean "master" copy. So, if you do as I described above before
deploying the "master" copy, your project will launch in exactly the same
way every time.
 
Z

ZRexRider

Thank you - sorry I missed your response here. After giving it some
thought I felt that this was not the best group to post since lots of
people don't bother with ADP projects.
 

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