• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 564
  • Last Modified:

ADP disconnect / reconnect using code

Hi there,

We've written a utility (ADP - SQL backend / Access ADP on the front) that we need to disconnect from the SQL server via code each night and then reconnect early in the morning.  Does anyone know how to do this via code?  Thanks!
0
CameronFrasnelly
Asked:
CameronFrasnelly
  • 2
  • 2
1 Solution
 
Data-ManCommented:
Is the application closed every night.  shutting down the ADP will disconnect if from SQL Server.  May I ask why you want to do this via code?

Mike
0
 
CameronFrasnellyAuthor Commented:
No we don't want to ever shut the application down.  We shutdown our SQL servers each night prior to backing them up which causes our utility to error out so we need to shut it down at 11pm and re-connect at 2am.  And I can't get anyone to volunteer to come in! :)
0
 
Data-ManCommented:
Take a look at the close connection method

CurrentProject.CloseConnection

Then, look at the OpenConnection to re-established the connection

Create a hidden form and set the timer interval.  When the event fires, check the current time...if 11PM, then close the connection.   When the time is 2AM, open the connection.


Mike
0
 
CameronFrasnellyAuthor Commented:
Thanks did some digging on google for CurrentProject.CloseConnection and found some sample code!
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!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now