473,664 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to find the active connection string

137 New Member
i have two databases for a single software in two different servers. i want to connect to the active server. if one server is down then it should automatically connect to another server. how to find out which one is active which is not ?
i have used postgres database and vb6.
Apr 3 '12 #1
3 1874
debasisdas
8,127 Recognized Expert Expert
Try to open the 1st database, if it is not accessible try to open the 2nd database.
Apr 6 '12 #2
coolminded
137 New Member
thank you debasisdas for your answer. but how to know that the database is inaccessible. because it will show the error message with "connection error" when the database is not accessible.
thank you
Apr 15 '12 #3
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Use Error Handler... First Open Conn to First server, If it opens without error, Exit Sub... OR Else try to Open Conn to second server..

Regards
Veena
Apr 18 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
55672
by: kant | last post by:
stringA= "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;PWD=password;Initial Catalog=DB;Data Source=127.0.0.1;Connect Timeout=30" stringB = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("DB.MDB") & ";Connect Timeout=30" Hi All,
1
2286
by: Duncan Winn | last post by:
I am trying to connect to an INTRBASE database through the MS OleDb.NET provider, however I am unsure of what to use for the connection string. How can I find this out???
12
3460
by: Charlie | last post by:
Hi: My host will not allow me use a trusted connection or make registry setting, so I'm stuck trying find a way to hide connection string which will be stored in web.config file. If I encrypt string externally, can it be used in it's encrypted form to connect to SQL Server? If I decrypt back to string for use in connection string during runtime, I have to supply a key. If I do that, hacker could use key to break encryption. How do I...
2
4694
by: Naveen | last post by:
Hi All, I have developed an application in ASP.NET and everything went fine till i found a need to use Crystal Reports, after surfing I found that Crystal Reports can only be used when I have a pwd assigned to my access db. my previous connection string goes as follows: <add key="constring" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:/inetpub/wwwroot/myApplication/database/myDB.mdb;" />
1
4875
by: james | last post by:
I am creating an connection string at runtime using decryption (crypto libraries). i have a very unpridictable error while assinging the generated connection string to the connection property. my code is something like this ... Public Function DbconnStr(ByVal UID As String, ByVal Pwd As String, _ ByVal ServerName As String,
3
8327
by: John | last post by:
Hi I have a dataset from a web service. I want to use a dataadapter with the dataset. What connection string should I use so the da knows that it is acting on the remote db associated with the web service dataset? Thanks Regards
0
1332
by: christophe.leroquais | last post by:
Hello, i can't find the connection string (and the def of the options) to access a flat file from SQL Server 2005. I guess it is something like: Provider=Microsoft.Jet.OLEDB.4.0; Data Source=MyFlatFile; Extended Properties=... etc.etc Can anyone help me?
1
6053
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while during the runtime, the user can click on a button and change the connection string without exiting the application. I would really appreciate any sort of help.
1
1272
by: kmcq | last post by:
I've contacted my host and they have no idea what connection string I need to use to access the MS SQL database we have running on their equipment. I'm trying to connection from ASP using OLE. Important info: Host Name: mssql1.3zhosting.com Database name: hopstec_membership Database login: hopstec_hopsvb Database users hopstec_access
3
3066
by: Jiwei06xie | last post by:
Dear expert, I got two forms. form1: Combox form Form_rptStock (key field: serial number), with one command button. form2: Entryform Entryform_stock, with a series of command buttons. I use this form to add new record or edit/delete a record. (it works perfect independently) What I am trying to do is when I select a serial number from the dropdown and click the command button cmdEdit in the 1st form, I wish the 2nd form will open and...
0
8437
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8778
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7375
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4185
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2764
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1759
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.