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.
ScottGutmanAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Vadim RappConnect With a Mentor Commented:
run this in vba immediate window:

Application.CurrentProject.CloseConnection 'Close the Connection
Application.CurrentProject.OpenConnection '
0
 
Leigh PurvisConnect With a Mentor Database DeveloperCommented:
AFAIK the only way to have the ADP *start-up* without attempting a connection is to create a blank ADP file and Cancel any requests for establishing the connection through the UI.
Then import all your objects into that ADP and go with it.
Any attempt to close or remove the ADP's default connection does not persist into the next instance of the application.

Sorry - it's a faff, but at least you have the workaround and could do it only before releasing new versions (just like part of the process such as creating an ADE etc etc).
0
 
Vadim RappCommented:
> 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?
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
Leigh PurvisDatabase DeveloperCommented:
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.
0
 
ScottGutmanAuthor Commented:
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?
0
 
ScottGutmanAuthor Commented:
the answer was just too simple and LPurvis usually knows EVERYTHING :).

Thanks a bunch, guys!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.