Find MS SQL Servers on a network, How To

I have used the following code to find MS SQL Servers on a LAN.

procedure GetAvailableServers (Var slServerList : TStringList);
objList : OleVariant;
iCount: Integer;
obj : OleVariant;
obj := CreateOleObject('SQLDMO.Application');
objlist := obj.ListAvailableSQlServers;
for iCount := 1 to objList.Count  do

It works on my PC only which is the development PC. Other PCs running Win 2000 error with "Invalid Class String" and I am pretty certain it is erroring in the main line,
obj := CreateOleObject('SQLDMO.Application');

Is there another method for locating running MS SQL Servers on a LAN without using comobj OR what dll do I need to copy to the other PCs and register for this code to work and not error. All pcs are using MS SQL server and can connect to MS SQL server just fine.

LVL 18
Who is Participating?
JohnjcesAuthor Commented:
Well I did a search on this site and found a lot of other stuff but not what I was looking for!

Thanks for searching!
all I searched for was:

Find SQL Servers

and checked "Restrict to this Topic Area"
first hit was the right answer... I knew it was here somewhere
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.