I cannot connect to a SQL Server using a DSN.Can anyone
tell me what is wrong. I have included the code below:
Friend Function GetConnection(ByVal strDSN As String) As
Microsoft.Data.Odbc.OdbcConnection
If strDSN Is Nothing Then Return Nothing
If strDSN = "" Then Return Nothing
Dim strConnectionString As String = "dsn=" & strDSN
Dim oConn As OdbcConnection
Try
oConn = New OdbcConnection(strConnectionString)
oConn.Open()
Return oConn
oConn.Dispose()
Catch eGen As Exception
Finally
End Try
End Function