Solved

Start ADP without setting the connection to SQL

Posted on 2008-06-19
8
750 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

808 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