Link to home
Start Free TrialLog in
Avatar of ScottGutman
ScottGutman

asked on

Start ADP without setting the connection to SQL

My goal is to use the same ADP on 2 different networks, with 2 different SQL Servers and 2 different database names, so the connections strings are different.

I programatically change the connection during the startup, but I have to wait for a timeout on the default connection.

How can i start the ADP without connecting to the SQL DB, so that I can change the connection strings in VBA.
ASKER CERTIFIED SOLUTION
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> Any attempt to close or remove the ADP's default connection does not persist into the next instance of the application.

Not any. Put empty OpenConnection in form_close event, and it will persist.

ScottGutman, I'm very curious, did you try what I suggested?
Fair play - that's a new one on me (not that I'd claim to be an authority on ADPs anyway).
The old literature on the subject is clearly unaware of the trick of calling the OpenConnection method without passing any connection information.

That's the answer you'll need Scott.
Avatar of ScottGutman
ScottGutman

ASKER

Ok, I was a little hasty.  Thanks for bringing this to my attention.  can the moderator undo my selection so i can change the points assigned?
the answer was just too simple and LPurvis usually knows EVERYTHING :).

Thanks a bunch, guys!