?
Solved

Start ADP without setting the connection to SQL

Posted on 2008-06-19
8
Medium Priority
?
753 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
8 Comments
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 1600 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 400 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

762 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