How can read all database names in MSDE by VB


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

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

  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.

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center