Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't connect to servers with SQLSMO
Message
 
 
To
02/12/2002 00:07:52
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00728512
Message ID:
00728564
Views:
24
Alex,

This works on my PC.
CLEAR
oSQLApp = CreateObject('SQLDMO.Application')
oServers = oSQLApp.ListAvailableSQLServers()
FOR EACH lcServer IN oServers
	? lcServer
ENDFOR
>>Hi Alex,
>>
>>Try
CLEAR
>>oSQLApp = CreateObject('SQLDMO.Application')
>>oServers = oSQLApp.ListAvailableSQLServers()
>>For i = 1 TO oServers.Count
>>	? i, oServers.Item(i)
>>EndFor
Does it work?
>
>Yes it did. Now I'll have to see why the other one didn't: Doing a trace and guessing at the way to access collection items returned by ListAvailableServers (it is via Item[x]) I see that item[1] is indeed "(local)". An error 1429 (ole error) ocurrs in the next line of code which contains the command:
>FOR EACH lcServer in loServer && (loServer is the equivalent of your oServers object.
>
>Any suggestions?
>
>Thanks for the help.
>
>Alex
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform