Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    34

    Unanswered: Available SQL Servers

    Does anyone know how can I view the names of available SQL servers from within VB?

    i.e. Make a combobox that shows available SQL servers.

    thanks

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    There is a Win API call to enumerate servers. I don't have any reference tools handy, but that should be enough to get you rolling.

    -PatP

  3. #3
    Join Date
    Mar 2004
    Posts
    34
    I did find an API function that can show me available resources but let's say I'm only searching for SQL servers and nothing else. Can you get me a step further?

  4. #4
    Join Date
    Nov 2002
    Posts
    833
    Originally posted by Wolverchenus
    I did find an API function that can show me available resources but let's say I'm only searching for SQL servers and nothing else. Can you get me a step further?
    sql.ini from your sqlclient should give you a list of the available servers

  5. #5
    Join Date
    Mar 2004
    Posts
    34
    You mean the computer connecting to the SQL server should have this file? 'cause I searched this one computer and didn't find it. Where should it be if so?

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Originally posted by Wolverchenus
    I did find an API function that can show me available resources but let's say I'm only searching for SQL servers and nothing else. Can you get me a step further?
    The simple answer is SQLOLEDB Enumerator, but what I'd originally thought of (what I use) is NetServerEnum using the SV_TYPE_SQLSERVER.

    -PatP

  7. #7
    Join Date
    Mar 2004
    Posts
    34
    The SQL Enumerator isn't exactly VB..
    Anything closer to home?
    I couldn't find NetServerEnum in the API viewer either. Might be because I'm using VB6.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •