Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Servers and name of databases
Message
 
To
24/09/2003 14:07:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00831930
Message ID:
00832195
Views:
26
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
Previous
Reply
Map
View

Click here to load this message in the networking platform