K
Karl
We have an application which checks users against a regularly updated
xls spreadsheet from our client. We need to be able to connect to this
xls on our remote server and so have decided to use a DSN. When I used
VB.Net to test the connection there were no errors, however when I use
asp.net to get the connection I do get one.
I cant use a relative path to the file as is normal in a
connectionstring as the environment is a shared one.
The code is shown below. Please help.
VB.NET CODE:
Try
Dim oEConn As New OdbcConnection
oEConn.ConnectionString = "DSN=members_bmf"
oEConn.Open()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
ASP.NET Code
Try
Dim oEConn As New OdbcConnection
oEConn.ConnectionString = "DSN=members_bmf"
oEConn.Open()
Catch ex As Exception
'errMessage is an asp.netlabel
errMessage.text =ex.ToString
End Try
Here is the error
System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified at
System.Data.Odbc.OdbcConnection.Open() at
ASP.bmf_validate_bmf_member_ascx.CheckMembership(Object sender,
EventArgs e) in \\TLBFS01\development\Projects\Tradecounter\Portal
Development\TCCPortal
Development\modules\bmf_validate_bmf_member.ascx:line 41
xls spreadsheet from our client. We need to be able to connect to this
xls on our remote server and so have decided to use a DSN. When I used
VB.Net to test the connection there were no errors, however when I use
asp.net to get the connection I do get one.
I cant use a relative path to the file as is normal in a
connectionstring as the environment is a shared one.
The code is shown below. Please help.
VB.NET CODE:
Try
Dim oEConn As New OdbcConnection
oEConn.ConnectionString = "DSN=members_bmf"
oEConn.Open()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
ASP.NET Code
Try
Dim oEConn As New OdbcConnection
oEConn.ConnectionString = "DSN=members_bmf"
oEConn.Open()
Catch ex As Exception
'errMessage is an asp.netlabel
errMessage.text =ex.ToString
End Try
Here is the error
System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified at
System.Data.Odbc.OdbcConnection.Open() at
ASP.bmf_validate_bmf_member_ascx.CheckMembership(Object sender,
EventArgs e) in \\TLBFS01\development\Projects\Tradecounter\Portal
Development\TCCPortal
Development\modules\bmf_validate_bmf_member.ascx:line 41