Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 19th, 2006, 02:01 PM
fah_metal fah_metal is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 1 fah_metal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 27 sec
Reputation Power: 0
What is wrong with this SQL syntax?? (USING ASP)

Hello,
I have a page that checks for username and password and redirects ueser to the appropriate page...
Could someone tell me what is wrong with my SQL syntax

Code:
Sub something()
a = request.form("Emp_Id")
b = request.form("Emp_Pass")
[MYSQL]SQL = "SELECT * from Authentication WHERE [Emp_Id] = '"& a &"' AND WHERE [Emp_Pass] = '"& b &"'"[/MYSQL] 
set rs = conn.execute(SQL)
If rs.EOF Then
  Session("Authenticated") = 0
 Response.Redirect ("default.asp")
 Else
  Session("Authenticated") = 1
  Response.Redirect ("pick.asp")
End If
End Sub


The error i get in the explorer is
Quote:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression '[Emp_Id] = '1234' AND WHERE [Emp_Pass] = '1234''.
/kes/verify.asp, line 16


Any help is appreciated.

Faheem.
a.faheem@gmail.com

Reply With Quote
  #2  
Old January 19th, 2006, 02:37 PM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
Click here for more information.
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,867 mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 15 h 20 m 54 sec
Reputation Power: 1762
try this:
Code:
SQL = "SELECT * from Authentication WHERE [Emp_Id] = '"& a &"' AND [Emp_Pass] = '"& b &"'"


you don't use a second where statement, you just seperate them with AND or OR
__________________
Come JOIN the party!!!

Quote of the Month:
Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use.

Questions to Ponder:
What do you do when you see an endangered animal eating an endangered plant?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright© 2008 sbenj69

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > What is wrong with this SQL syntax?? (USING ASP)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT