Print Page | Close Window

Problem in Select from DB !!!

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3179
Printed Date: 29 March 2026 at 10:14am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Problem in Select from DB !!!
Posted By: Augean
Subject: Problem in Select from DB !!!
Date Posted: 31 May 2003 at 4:02pm

Hi

I have problem when I want to select record from DB
I use this sql statement :

Set RS = MyConn.Execute ("SELECT * FROM tblUsers WHERE UID = '" & nID & "'")

now if "UID" is a Text in my DB it works good , but if it is a number it doesnt .

in other word , if the field that I put in "WHERE" statement , is a TEXT it works but not when it is NUMBER.

How can I make it works ??
I'll appreciate any help or any idea .

Thank you
~Augean



-------------
Ozhen M.
mailto:a_minashy@yahoo.com - a_minashy@yahoo.com



Replies:
Posted By: pmormr
Date Posted: 31 May 2003 at 5:21pm
whats the number contain... the ADO engine doesn't like some number formats. Also, make sure that it doesn't contain stuff like ./\=, stuff like that.

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: MorningZ
Date Posted: 31 May 2003 at 6:43pm

if UID is set as a number, dont surrond the right side of the equation in single quotes

the quotes are for string comparison



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Bullschmidt
Date Posted: 31 May 2003 at 10:51pm

<<if UID is set as a number, dont surrond the right side of the equation in single quotes>>

And here's the example without the single quotes:

Set RS = MyConn.Execute ("SELECT * FROM tblUsers WHERE UID = " & nID)



-------------
J. Paul Schmidt, Freelance ASP Web Developer
www.Bullschmidt.com - www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample (Freely Downloadable)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net