Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 6th, 2003, 03:55 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old July 7th, 2003, 06:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This section of the site it dedicated to feedback on the site. I think you would have more luck posting the question to a .Net forum.

regards
David Cameron
 
Old July 8th, 2003, 04:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Martyn,

The movement to ASP.NET is more than using a .NET Framework namespaces.
Firstly, you have to decided about the language u use, and then u have to overcome the language's syntax.
The next step is to learn about ASP.NET features. MSDN is always a good learning source, but there is a zillion tutorials on the net related to ASP.NET beginning.

Regards,
NNJ

...but the Soon is eclipsed by the Moon
 
Old July 22nd, 2003, 10:32 PM
Authorized User
 
Join Date: Jun 2003
Location: Quezon City, MM, Philippines.
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

In your sample code's connection string, just replace the & with a +, because the & that works in joining two strings in ASP 3.0 is replaced by the + operator in .NET:

objConn = New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; data source=" + server.mappath("dbNemo.mdb"))


Cheers!
Marlon




Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the error message for a 500 server error? chobo2 C# 2005 1 May 4th, 2008 03:11 AM
Error in AddEditArticle.aspx learningASP BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 May 31st, 2007 08:15 PM
error in browser.aspx raja_699 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 January 20th, 2005 02:31 AM
roles.aspx error groupmatch BOOK: ASP.NET Website Programming Problem-Design-Solution 4 September 13th, 2004 02:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.