[dba-SQLServer] VB.Net - Connection Open doesn't

Eric Barro ebarro at verizon.net
Sat Jun 2 17:00:08 CDT 2007


John,

A couple of things to try...

1. Data Source = Azul

Since you are connecting to a remote machine it needs to reference the
machine as \\AZUL\AZUL or <ip address of Azul>\Azul

2. Integrated Security=SSPI

You need to make sure that Windows account you are using on your laptop is
also on the Azul machine, otherwise it won't be able to authenticate
correctly. I use SQL authentication by creating a SQL login.

3. Make sure that Azul has TCPIP port 1433 open so that the remote machine
can connect over a TCPIP connection.

Eric 

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Saturday, June 02, 2007 7:39 AM
To: dba-sqlserver at databaseadvisors.com
Subject: [dba-SQLServer] VB.Net - Connection Open doesn't

I created the following code, which was tested and working when running on
the machine that the database server resides on.  I am now trying to run it
from my laptop, which is my development machine.  This class is initialized
in the button click on a form just for troubleshooting purposes.  The code
steps in to the new constructor , the mobjCn is set, it drops into the Try
and then steps into the open and hangs, never to return.

StrConnection is:

Provider=SQLOLEDB;Data Source = Azul;Initial Catalog = Infutor;Integrated
Security=SSPI

Azul is both the name of the machine running SQL Server 2005 and the name of
a SQL Server instance on machine Azul, which can be seen and manipulated
from the laptop.  Infutor is a specific database which can be seen and
manipulated from the laptop.  SSPI I do not understand the definition of, it
was something that I tried and it worked from the SQL Server machine (also
named Azul).

Public Class clsProcessData
    Private mobjCn As OleDbConnection
    Private mobjDA As New OleDbDataAdapter
    Private mobjDS As DataSet
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <param name="strConnection"></param>
    ''' <remarks></remarks>
    Public Sub New(ByVal strConnection As String)
        mobjCn = New OleDbConnection(strConnection)
        Try
            Debug.Print(strConnection)
            mobjCn.Open()
        Catch ex As OleDbException
            MessageBox.Show("Could not open the connection: " +
strConnection)
        End Try
        mobjDA.SelectCommand = New OleDbCommand
        mobjDA.SelectCommand.Connection = mobjCn
        mobjDS = New DataSet
    End Sub

Any ideas what to try here?


John W. Colby
Colby Consulting
www.ColbyConsulting.com 

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.472 / Virus Database: 269.8.6/828 - Release Date: 6/1/2007
11:22 AM
 




More information about the dba-SQLServer mailing list