[AccessD] OT - Using Connection Strings For Disaster Recovery

Bruen, Bruce Bruce.Bruen at railcorp.nsw.gov.au
Thu Dec 8 23:58:20 CST 2005


Why not just try to open the connection?  I mean, the overhead is
nothing, you get a status return that tells you that the
lan+server+db+connection is available (or not) and so you can continue
(or not).

bruce



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael
Maddison
Sent: Friday, 9 December 2005 4:53 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] OT - Using Connection Strings For Disaster
Recovery

I don't believe it is possible.
You have to try to connect and catch the error, if there is one.  
Pinging the server is no good because the server may be up but the db
may be down.
The type of disaster recovery you are looking at is usually accomplished
with RAID, clustered servers, that type of thing and definitely not my
thing ;-) Failover is what they call it IIRC.  If 1 server dies a mirror
image takes over.

cheers

Michael M


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Paul Hartland
(ISHARP)
Sent: Friday, 9 December 2005 12:08 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] OT - Using Connection Strings For Disaster Recovery

To all,

I am work on implementing a new section to the disaster recovery of my
own projects, one of the things I am currently looking into is having a
.ini file with connection string to my main server something like:

	Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;User ID=myusername;Initial Catalog=mydatabase;Data
Source=mysourcemain1

Each day I make my own backup of the main database, but if our main
server went down what I want to be able to detect if the connection
string is valid, if not use the next one in the sequence:

	Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;User ID=myusername;Initial Catalog=mydatabase;Data
Source=mysourcemain2

So that although my dataenvironment, ADO controls etc point to
mysourcemain1, if mysourcemain1 shuts down...I can go to the latest
backup that I have and restore on mysourcemain2 then let everyone back
in again....i.e. I want something like the following:

	Open the .ini file as text
	Check if the first connection string is ok
	if ok then set the datasources to it
	if not ok warn user and alert administraors of possibility of
server down
	get the next connection string and recheck 
	loop until found valid string

Is there a way of check if a connection string to a SQL Server would
work before trying to open the connection ?

If anyone could help me on this I would be very grateful, sample code
and/or guidance greatly appreciated.

Thanks in advance.

Paul Hartland

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




This e-mail and any attachments may contain confidential information that is intended solely for the use of the intended recipient and may be subject to copyright. If you receive this e-mail in error, please notify the sender immediately and delete the e-mail and its attachments from your system. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. Any opinion expressed in this e-mail and any attachments is not an opinion of RailCorp unless stated or apparent from its content. RailCorp is not responsible for any unauthorised alterations to this e-mail or any attachments. RailCorp will not incur any liability resulting directly or indirectly as a result of the recipient accessing any of the attached files that may contain a virus.



More information about the AccessD mailing list