473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Connect to SQL server 2005 using SQLDMO

Hi all
i need to know if sql dmo can connect to SQL server 2005
if can! how can i do this ??

i have this code

Dim xServer a SQLDMO.Server
......bla..bla...

xServer.LoginSecure = True
xServer.Connect("SQLServer2005")

but it can´t connect.
is there anyother way ??

thks
JSB
Jul 21 '05 #1
3 1449
Hi,

What are you trying to do with sqldmo?

Ken
-----------------
"Joăo Santa Bárbara" <jo****@i24portugal.com> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...
Hi all
i need to know if sql dmo can connect to SQL server 2005
if can! how can i do this ??

i have this code

Dim xServer a SQLDMO.Server
......bla..bla...

xServer.LoginSecure = True
xServer.Connect("SQLServer2005")

but it can´t connect.
is there anyother way ??

thks
JSB

Jul 21 '05 #2
i just want the get databases listname

thks

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

What are you trying to do with sqldmo?

Ken
-----------------
"Joăo Santa Bárbara" <jo****@i24portugal.com> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...
Hi all
i need to know if sql dmo can connect to SQL server 2005
if can! how can i do this ??

i have this code

Dim xServer a SQLDMO.Server
.....bla..bla...

xServer.LoginSecure = True
xServer.Connect("SQLServer2005")

but it can´t connect.
is there anyother way ??

thks
JSB

Jul 21 '05 #3
Hi,

Use the sp_databases stored procedure to list database names.

Dim strConn As String

Dim conn As SqlConnection

Dim cmd As SqlCommand

Dim dr As SqlDataReader

strConn = "Server =(local);"

strConn &= "Database = ; Integrated Security = SSPI;"

conn = New SqlConnection(strConn)

cmd = New SqlCommand("sp_Databases", conn)

cmd.CommandType = CommandType.StoredProcedure

conn.Open()

dr = cmd.ExecuteReader

If dr.HasRows Then

Do While dr.Read

Trace.WriteLine(String.Format("Name {0} Size {1}", _

dr.Item("Database_Name"), dr.Item("Database_Size")))

Loop

End If

dr.Close()

conn.Close()

Ken

----------------------

"Joăo Santa Bárbara" <jo****@i24portugal.com> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
i just want the get databases listname

thks

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

What are you trying to do with sqldmo?

Ken
-----------------
"Joăo Santa Bárbara" <jo****@i24portugal.com> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...
Hi all
i need to know if sql dmo can connect to SQL server 2005
if can! how can i do this ??

i have this code

Dim xServer a SQLDMO.Server
.....bla..bla...

xServer.LoginSecure = True
xServer.Connect("SQLServer2005")

but it can´t connect.
is there anyother way ??

thks
JSB


Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
by: ik | last post by:
ERROR after uninstalling SQL Server 2005 Express I get this message, SQLDMO has not been registered. Please re-run your setupand contact your system administrator. GREAT!!! ReInstalled SQL...
5
by: Christian Pické | last post by:
Hi, I want to deploy my Windows Application written in C#. I am using SQL Server and I wonder if there is a way to detect computers that run SQL Server or MSDE, so I can connect to them 1) to...
6
by: Claire | last post by:
My dotnet windows service, that is sampling data in real time, sits on 1 machine and the SQL server it talks to is likely to be sited on a different pc. The pcs are situated in an environment...
1
by: Cui | last post by:
Hello, I make an application in ASP.NET (using VB.NET and some web services). For my needs, I use also the SQL DMO library (with the SQL DMO.interop assembly) and the Microsoft Web UI controls...
7
by: John | last post by:
Do you guys have any idea if web hosting companies usually give access to SQL Server databases through Enterprise Manager? I used to have have access to my DB through EE with my previous provider...
3
by: Joăo Santa Bárbara | last post by:
Hi all i need to know if sql dmo can connect to SQL server 2005 if can! how can i do this ?? i have this code Dim xServer a SQLDMO.Server ......bla..bla... xServer.LoginSecure = True
3
by: John Veldthuis | last post by:
I am trying to find instances of all the SQL servers on the local network including the machine it is running from. The servers will be a mix of SQL2000 and SQL2005 once it is ready. I have been...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
5
by: Alan Silver | last post by:
Hello, Server configuration: Windows 2003 Server SP2 SQL Server 2000 SP4 ..NET v2.0.50727 just built up a new server using the same configuration as my current one. I even used the same CDs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.