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

jwcolby jwcolby at colbyconsulting.com
Sat Jun 2 09:38:50 CDT 2007


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 




More information about the dba-SQLServer mailing list