aspx error message...
Hello, I'm making the transition to aspx from classic asp. One problem I don't seem to be able to resolve is how to make a DSN connection - all the info I've read seems to point to the fact that it can't be done, surely this isn't the case???
Anyway, the main point of this posting is the following error message:
-------------------------------------------------------------------
Compilation Error
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: CS1519: Invalid token '=' in class, struct, or interface member declaration
Line 10: objConn = New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("dbNemo.mdb"))
Source File: c:\inetpub\wwwroot\captainnemo\www\index.aspx Line: 10
-------------------------------------------------------------------
Here is the source code I'm using...
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
sub Page_Load;
Dim objConn;
Dim strSQL;
Dim objComm;
Dim objRead;
objConn = New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("dbNemo.mdb"))
objConn.Open()
strSQL = "SELECT * FROM tblContent "
strSQL = strSQL & "WHERE dbContentID=1"
objComm=New OleDbCommand(strSQL,objConn)
objRead=objComm.ExecuteReader()
dsContent.DataSource=objRead
dsContent.DataBind()
objRead.Close()
objConn.Close()
end sub
</script>
Can anyone tell me where I'm going wrong? And also if there's a way of making a DSN connection?
TIA
Martyn
|