p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: plz check my sql syntax


Message #1 by "Taher Moiyed" <taherm@f...> on Fri, 15 Jun 2001 10:28:31
i usually specify which fields that i need as opposed to select *. it 
will give you better performance.
ken has a study on this go to www.adOpenStatic.com (dont you just love 
that address.. i do:-)

daniel

Daniel O'Dorisio
dodorisio@h...
xxx-xxx-xxxx


-----Original Message-----
From: Fotopoulos, Lefteris [mailto:LFot@e...]
Sent: Friday, June 15, 2001 5:48 AM
To: Code Clinic
Subject: [proasp_codeclinic] RE: plz check my sql syntax


A good tactic is to print the output query and run it(Query Analyzer) to 
see
if it's OK.
As for your query:
use:
"SELECT * FROM Contactsnew WHERE FirstName=3D '" & var1 & "' or 
LastName=3D'" &
var1 & "'"
instead of:

"SELECT * FROM Contactsnew WHERE FirstName=3D '" & var1 & "'" & "or
LastName=3D'" & var1 & "'"

----------------------------
Eleftherios C. Fotopoulos
Development
Eurocom Expertise SA
19,7 L. Markopoulou, A5
19002, Peania
Greece
Tel.: +xxx xxxxxxx
http://www.eurocom.gr
mailto:lfot@e...
computer joke
support:"Click on your left mouse button"
customer:"But i have only one mouse"
----------------------------




-----Original Message-----
From: Taher Moiyed [mailto:taherm@f...]
Sent: Friday, June 15, 2001 1:29 PM
To: Code Clinic
Subject: [proasp_codeclinic] plz check my sql syntax


"SELECT * FROM Contactsnew WHERE FirstName=3D '" & var1 & "'" & "or
LastName=3D'" & var1 & "'"

var1 is a variable which get value from a text field. the name entered 
in
the text field can be either last name or first name.
plz let me know if teh above sql syntax is correct becuase i am not sure 

of the OR operator.

waiting for your reply
Thanks in advance


  Return to Index