Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Servers and name of databases
Message
 
À
24/09/2003 14:07:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00831930
Message ID:
00832195
Vues:
27
Lazaro,

You could try this.
* To populate the ComboBox with list of servers:
LOCAL loApp, loServerNames, i
loApp=CREATEOBJECT('SQLDMO.Application')
loServerNames=loApp.ListAvailableSQLServers
With loServerNames
	For i = 1 To .Count
		Thisform.cboServers.AddItem(UPPER(.Item(i)))
	NEXT i
EndWith


* To populate the ListBox with all the Databases from the server:
loServer   = CREATEOBJECT('SQLDMO.SqlServer')

With loServer
   .Connect(lcServerName, lcUserName, lcPassword)

   For i = 1 To .Databases.Count
	ThisForm.ListDatabases.AddItem(.Databases(i).Name)
   Next i
EndWith
Cheers,

Zoran





>Hi !
>
>How I make to catch the servers and name of databases as well as appears in the
>utility SQL Query Analizer using vfp7.0?
>
>Thanks
>
>Lázaro Santos
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform