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
Printable View
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
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
"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
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.