Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2007, 08:55 AM
Registered User
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default finding sql servers with sqldmo

I've written an MS Access app that connects to a sql server to get some data. I've used the following code to list available servers:
Sub GetListOfSQLServers()
    Dim k As Integer
    Dim oSQLServer As New SQLDMO.Application
    Dim oSS As SQLDMO.SQLServer
    Dim oServerNames As NameList
    Dim strServer As String
    strServer = ""
    Set oServerNames = oSQLServer.ListAvailableSQLServers()
    For k = 1 To oServerNames.Count
        strServer = oServerNames(k)
    Next k
    Debug.Print strServer
end sub

I have SQL Server 2005 Express installed and running on a standalone PC. But the code above returns two records - one says BOB\SQLEXPRESS, the other bob\sqlexpress. Anyone got any ideas why? And how I might deal with this unfriendly situation?
Ta ever so ...

BobS56





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Deployment to Shared Servers; SQL Script englere BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 May 17th, 2008 07:00 AM
Using linked SQL servers data in Access Irina_Ivanova Access 1 June 21st, 2007 05:12 PM
Problem With SQLDMO in VBNet toanquyen VS.NET 2002/2003 0 April 17th, 2007 07:18 AM
Different servers for IIS and SQL ganzoategui Classic ASP Databases 3 February 1st, 2005 06:00 PM
SQLDMO Connection Problem madhanagopal Pro VB.NET 2002/2003 0 September 14th, 2004 04:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.