Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 3rd, 2005, 01:48 PM
Registered User
Join Date: Jul 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Thac
Default System.Data.OleDb.OleDbException: Expected query n

Could someone please help me. I'm trying to access the data in a query in an Access 97 Database from my ASP.net page. I'm using Visual Studio.net and I keep getting the error:

Expected query name after EXECUTE.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Expected query name after EXECUTE.

Source Error:

Line 97: dbConnection.Open()
Line 98:
Line 99: Dim dataReader As System.Data.oledb.OleDbDataReader = dbCommand.ExecuteReader()

Here's my code:
    Function drGetClasses(ByVal ClassNo As Integer) As System.Data.oledb.OleDbDataReader
        Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(DBCalls.connecti onstring)

        Dim QueryString As String

        QueryString = "SELECT * From qryClasses" ' & ClassNo

        Dim dbCommand As New OleDb.OleDbCommand
        dbCommand.CommandText = QueryString
        dbCommand.Connection = dbConnection
        dbCommand.CommandType = CommandType.StoredProcedure
        dbCommand.Parameters.Add("@ClassNo", System.Data.OleDb.OleDbType.Integer)
        dbCommand.Parameters("@ClassNo").Value = ClassNo


        Dim dataReader As System.Data.oledb.OleDbDataReader = dbCommand.ExecuteReader()

        Return dataReader
    End Function
Thank You.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Data.OleDb.OleDbException: No value given f tjgrindsted ASP.NET 2.0 Basics 0 January 24th, 2007 07:25 AM
An unhandled exception of type 'System.Data.OleDb. Harvey_swift VB Databases Basics 1 May 30th, 2006 12:57 PM
using oledb to retrieve data from sql server w A2K nikesierra2306 Access VBA 0 October 20th, 2004 04:36 PM
OleDbException (0x80004005): Confused ASP.NET 1.0 and 1.1 Basics 13 April 24th, 2004 11:21 PM

All times are GMT -4. The time now is 11:05 AM.

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