|
 |
aspx_beginners thread: ODBC.Net
Message #1 by "Andy" <andy@t...> on Wed, 29 Jan 2003 05:13:09 +0800
|
|
Hello,
Getting the below error message when trying to connect to my Access Database
:
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'microsoft.data.OdbcConnection' is not
defined.
Source Error:
Line 5:
Line 6: <%
Line 7: Dim cn as microsoft.data.OdbcConnection
Line 8: cn = New OdbcConnection ("dsn=test;")
Line 9: Dim mystring As String = "Select * from files"
Below is my sample coding :
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Microsoft.Data.ODBC" %>
<%
Dim cn as microsoft.data.OdbcConnection
cn = New OdbcConnection ("dsn=test;")
Dim mystring As String = "Select * from files"
Dim cmd As OdbcCommand = New OdbcCommand(mystring)
cn.Open()
cn.Close()
%>
I have checked on the server that the ODBC.Net Data Provider is
installed.Can someone help me ?
THanks.
Andy
Message #2 by Ali Ahmad H <ali@a...> on Wed, 29 Jan 2003 14:43:41 +0700
|
|
Hi Andy,
in your code, use Microsoft.Data.Odbc.OdbcConnection.
your code should be :
.......
Dim cn as Microsoft.Data.Odbc.OdbcConnection
cn = New OdbcConnection ("dsn=test;")
Dim mystring As String = "Select * from files"
.......
regards,
-ali-
At 05:13 AM 1/29/2003 +0800, you wrote:
>Hello,
>
>Getting the below error message when trying to connect to my Access Database
>:
>
>Description: An error occurred during the compilation of a resource required
>to service this request. Please review the following specific error details
>and modify your source code appropriately.
>
>Compiler Error Message: BC30002: Type 'microsoft.data.OdbcConnection' is not
>defined.
|
|
 |