DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    WHB Guest

    How can read all database names in MSDE by VB


    I want to develop an application based on MSDE and VB, When Login form load,
    I want the user can select the database which he want to operate. How can
    I read databse names by VB?
    Thanks very much

  2. #2
    Tonny H Guest

    Re: How can read all database names in MSDE by VB


    SELECT * FROM SYSOBJECTS
    that should return all table names

    -t-

    "WHB" <wanghanbo@hotmail.com> wrote:
    >
    >I want to develop an application based on MSDE and VB, When Login form load,
    >I want the user can select the database which he want to operate. How can
    >I read databse names by VB?
    >Thanks very much



  3. #3
    Bob Feldsien Guest

    Re: How can read all database names in MSDE by VB


    "WHB" <wanghanbo@hotmail.com> wrote:
    >
    >I want to develop an application based on MSDE and VB, When Login form load,
    >I want the user can select the database which he want to operate. How can
    >I read databse names by VB?
    >Thanks very much


    You might like to use SQL-DMO for this .
    example:
    Set sDMO = New SQLDMO.SQLServer
    sDMO.Start True, ComputerName, "sa", ""
    For Each DB In sDMO.Databases
    Me.cboDB.AddItem DB.Name
    Next

    By the way, I also am doing a fairly extensive project using MSDE. I haven't
    had much luck with the user groups so far. If you would be interested in
    corresponding directly, please feel free.

    Bob Feldsien


  4. #4
    Chris H Guest

    Re: How can read all database names in MSDE by VB


    Use the SQL:

    SELECT Name FROM master.dbo.sysdatabases
    WHERE Name NOT IN ('master','tempdb','model','Northwind','Pubs')

    This will give you all the user-created databases on the server.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links