PC Review


Reply
Thread Tools Rate Thread

Connect to SQL server 2005 using SQLDMO

 
 
Joăo Santa Bárbara
Guest
Posts: n/a
 
      31st May 2005
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


 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      31st May 2005
Hi,

What are you trying to do with sqldmo?

Ken
-----------------
"Joăo Santa Bárbara" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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



 
Reply With Quote
 
 
 
 
Joăo Santa Bárbara
Guest
Posts: n/a
 
      31st May 2005
i just want the get databases listname

thks



"Ken Tucker [MVP]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> What are you trying to do with sqldmo?
>
> Ken
> -----------------
> "Joăo Santa Bárbara" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      31st May 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
i just want the get databases listname

thks



"Ken Tucker [MVP]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> What are you trying to do with sqldmo?
>
> Ken
> -----------------
> "Joăo Santa Bárbara" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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
>
>
>




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
any know issues in installing VB.NET 2005 Express, VS.NET 2005 Standard, SQL Server 2005 Express and SQL Server 2005 LeAnne Microsoft VB .NET 2 30th Dec 2005 12:27 PM
Connect to SQL server 2005 using SQLDMO Joăo Santa Bárbara Microsoft VB .NET 3 31st May 2005 12:35 PM
Security programs 2005 - , Firewall programs 2005 -, Antivirus programs 2005 -, APPDEV DOT NET SECURITY, Linux Security and Firewall programs 2005 -, CiscoWorks ( CW ) Security programs 2005 - , futa Microsoft Access Security 3 2nd Mar 2005 05:04 AM
Security programs 2005 - , Firewall programs 2005 -, Antivirus programs 2005 -, APPDEV DOT NET SECURITY, Linux Security and Firewall programs 2005 -, CiscoWorks ( CW ) Security programs 2005 - , futa Anti-Virus 0 25th Feb 2005 02:30 PM
McAfee 2005 All In One, McAfee AntiSpyware V1.0 2005, McAfee Personal Firewall Plus V6.0 2005, McAfee QuickClean V5.0 2005, McAfee SpamKiller V6.0 2005, McAfee VirusScan V9.0 2005, new !, other code_fu Anti-Virus 0 1st Oct 2004 11:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:17 AM.