473,400 Members | 2,163 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,400 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
Nov 21 '05 #1
3 4400
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

Nov 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

Nov 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


Nov 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...
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
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...
2
by: Hal Heinrich | last post by:
Given a server name, and before logging on to the server - how can I tell if it's using Windows Authentication Mode or SQL Server Authentication? I'm retreiving a list of servers as follows: Dim...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.