Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Find MS SQL Servers on a network, How To

Posted on 2005-03-04
3
Medium Priority
?
218 Views
Last Modified: 2010-04-05
I have used the following code to find MS SQL Servers on a LAN.

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

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.

Thanks!
0
Comment
Question by:Johnjces
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
BlackTigerX earned 375 total points
ID: 13461347
0
 
LVL 18

Author Comment

by:Johnjces
ID: 13461469
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!
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13461761
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
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question