Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 2nd, 2005, 08:52 PM
Authorized User
 
Join Date: Dec 2004
Location: , , .
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!
Reply With Quote
  #2 (permalink)  
Old February 2nd, 2005, 10:30 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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
Reply With Quote
  #3 (permalink)  
Old February 2nd, 2005, 10:53 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #4 (permalink)  
Old February 3rd, 2005, 05:02 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
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

Reply With Quote
  #5 (permalink)  
Old February 3rd, 2005, 09:12 AM
Authorized User
 
Join Date: Dec 2004
Location: , , .
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!
Reply With Quote
Reply


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
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



All times are GMT -4. The time now is 11:57 PM.


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