Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic ADP Connection Problem

Status
Not open for further replies.

Steve101

Programmer
Mar 29, 2002
1,473
0
0
AU
I use code to modify the connection properties of an ADP project. Once set, these properties tend to "stick" to the ADP file, and a subsequent re-open of the project and look at the connection properties confirms this.

This situation is fine, providing the connection exists, and can be made.

I now wish to / need to be able to move an ADP from one environment to another (for Disaster recovery purposes), and need to be able to pass the connection string via command line parameters. No problem here. I find however that when the project initiates, the "hard coded" connection string will cause failure. I am unsure how to trap and deal with this, as it seems to occur before the Autoexec macro fires, from where I would deal with the connection dynamics.

Anyone got any epxerience with this. How do I trap and deal with the invalid connection properties when the ADP is opening.

TIA,

Steve

Steve Lewy
Solutions Developer
SimplyData
simplydata.com.au
(dont cut corners or you'll go round in circles)
 
I don't know if you are still looking for this answer, but I use this code snippet as the first item in the function called from the autoexec macro and it works with no problems.

If Not CurrentProject.IsConnected Then
If gbDevelopment Then
CurrentProject.OpenConnection sDevelopmentString
Else
CurrentProject.OpenConnection sLiveString
End If
End If

Let me know if you need more info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top