Wrox Programmer Forums
| 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 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
  #1 (permalink)  
Old May 11th, 2005, 05:00 AM
Registered User
Join Date: May 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error in a query

Hi to all,
I have the following error
"Syntax error in JOIN operation"

this.oleDbCommand1.CommandText = "select Item from (((SELECT 1 as sortorder, PrimaryMenu.PrItems as Item FROM PrimaryMenu where PrimaryMenu.MenuID=1) union (SELECT 2 as sortorder, Category.CategoryName as Item FROM (Category INNER JOIN PrimaryMenu ON Category.MenuID = PrimaryMenu.MenuID) WHERE (PrimaryMenu.MenuID=1))))";

I use an Access database.
What the cause of the error?

  #2 (permalink)  
Old May 12th, 2005, 12:19 AM
Friend of Wrox
Join Date: Apr 2005
Location: Cochin, , India.
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts


"SELECT 2 as sortorder, Category.CategoryName as Item
FROM Category INNER JOIN PrimaryMenu ON Category.MenuID = PrimaryMenu.MenuID
 WHERE (PrimaryMenu.MenuID=1)"

Does this part work fine indipendently


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
error in query capri SQL Server 2000 5 April 4th, 2008 01:27 AM
error in query beetle_jaipur SQL Server 2000 9 April 4th, 2006 02:16 AM
Syntax error in query. Incomplete query clause. dispickle ADO.NET 3 April 16th, 2004 01:04 PM
Error on Make-Table Query In Union Query rylemer Access 1 August 20th, 2003 07:42 PM

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