Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Bronny
  Where is Bronny?
 Budapest
 Hungary
 Bronny
 Tags
Subject: RE: Named connection existence
Thread ID: 96346 Message ID: 96348 # Views: 39 # Ratings: 1
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Thursday, May 18, 2006 9:05:02 AM         
   


> There is a named connection it the database.
> We can delete it by
> DELETE CONNECTION D
> But how can we detect
> the named connection existence
> in the database?


Look for adbobjects() in the help.
It creates an array with info on the objects you need.
If there is no array then there is no connection.
If the array is created ascan() the array to find the name of the connection.
When that returns a zero the connection you want is not in the database and should be created.

So:
OPEN DATABASE MyNiftyDataBaseThatContainsConnections

IF ADBOBJECTS( laConnectionInfoIReallyNeed, "CONNECTION")>0
	IF ASCAN( laConnectionInfoIReallyNeed, "TheNameOfTheConnectionYouNeed")>0
		* Connection exists, nothing to do
	ELSE
		* create the connection as it is not in the DBC
	ENDIF
ENDIF


Boudewijn LutgeĀ®ink
My Blog is here


COMPLETE THREAD

Named connection existence Posted by Bronny @ 5/18/2006 9:03:32 AM
RE: Named connection existence Posted by Boudewijn Lutgerink @ 5/18/2006 9:05:02 AM
RE: Named connection existence Posted by Bronny @ 5/18/2006 10:22:20 AM
RE: Named connection existence Posted by mus bimo @ 5/18/2006 10:39:43 AM
RE: Named connection existence Posted by Borislav Borissov @ 5/18/2006 10:48:56 AM
RE: Named connection existence Posted by Bronny @ 5/19/2006 4:29:13 AM
RE: Named connection existence Posted by Bronny @ 5/19/2006 4:27:37 AM