Solved

Start ADP without setting the connection to SQL

Posted on 2008-06-19
8
744 Views
Last Modified: 2013-12-05
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.
0
Comment
Question by:ScottGutman
  • 2
  • 2
  • 2
8 Comments
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 400 total points
ID: 21821605
run this in vba immediate window:

Application.CurrentProject.CloseConnection 'Close the Connection
Application.CurrentProject.OpenConnection '
0
 
LVL 44

Assisted Solution

by:Leigh Purvis
Leigh Purvis earned 100 total points
ID: 21823808
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
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 21826463
> 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 21826803
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
 

Author Comment

by:ScottGutman
ID: 21829927
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
 

Author Closing Comment

by:ScottGutman
ID: 31468728
the answer was just too simple and LPurvis usually knows EVERYTHING :).

Thanks a bunch, guys!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now