Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 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 February 2nd, 2005, 08:52 PM
Authorized User
 
Join Date: Dec 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jaywhy13 Send a message via Yahoo to jaywhy13
Default Joins error.... please help!

I get the following error for this code....
Please help:
============================
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'users.username=userPreferences.username INNER JOIN displayOptions ON userPreferences.displayID=displayOptions.displayID '.

And the error is on the line where i do this:
RS.Open sqlAuthenticate, Conn, 3, 3
My RS is defined eariler



Code:
sqlAuthenticate="SELECT userPreferences.msgSort, userPreferences.msgDirection, 
users.username, users.password, users.picLocation, users.firstname FROM users 
LEFT JOIN userPreferences ON users.username=userPreferences.username INNER JOIN
displayOptions on userPreferences.displayID = displayOptions.displayID
WHERE users.username='" & user & "' AND users.password='" & password & "'"
I'm gonna download the internet if its the last thing I do....
Until the algorithm is finished u must prepared to bow down and worship me (or my grave).... i figured i'll b finished b4 the latter!
__________________
I\'m gonna download the internet if its the last thing I do....
Until the algorithm is finished u must prepared to bow down and worship me (or my grave).... i figured i\'ll b finished b4 the latter!
 
Old February 2nd, 2005, 10:30 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

can u response.write the SQL statement?

Also, please check for the Access driver as well. this might be an issue.

Om Prakash
 
Old February 2nd, 2005, 10:53 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

mmmm, I can not see a missing operator

Wind is your friend
Matt
 
Old February 3rd, 2005, 05:02 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Looks like it might be access's love of brackets around various joins that's the problem, also I think it may complain when you try to do a left join before an outer join.
Give this a try...
Code:
sqlAuthenticate="SELECT userPreferences.msgSort, userPreferences.msgDirection, 
users.username, users.password, users.picLocation, users.firstname FROM (users 
LEFT JOIN userPreferences ON users.username=userPreferences.username) LEFT JOIN
displayOptions on userPreferences.displayID = displayOptions.displayID
WHERE users.username='" & user & "' AND users.password='" & password & "';"
HTH,

Chris

 
Old February 3rd, 2005, 09:12 AM
Authorized User
 
Join Date: Dec 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jaywhy13 Send a message via Yahoo to jaywhy13
Default

thanks! That worked.... I wanted to really use an INNER JOIN for the last one but the LEFT JOIN will work still because there are matchin records for all.... so it still acts like a INNER JOIN tho thanks!

I'm gonna download the internet if its the last thing I do....
Until the algorithm is finished u must prepared to bow down and worship me (or my grave).... i figured i'll b finished b4 the latter!





Similar Threads
Thread Thread Starter Forum Replies Last Post
What are joins? Bhalchandra SQL Server 2000 2 July 2nd, 2007 11:29 PM
Joins nalla Oracle 0 December 14th, 2005 05:54 AM
Joins r_ganesh76 SQL Server 2000 2 February 10th, 2005 12:21 AM
Two outer joins Neil SQL Language 1 March 22nd, 2004 01:09 PM
Joins marthaj SQL Server 2000 7 June 26th, 2003 09:02 AM





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