Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Problem in Select from DB !!!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem in Select from DB !!!

 Post Reply Post Reply
Author
Augean View Drop Down
Newbie
Newbie
Avatar

Joined: 09 May 2003
Location: United States
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Augean Quote  Post ReplyReply Direct Link To This Post Topic: Problem in Select from DB !!!
    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

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Bullschmidt View Drop Down
Groupie
Groupie


Joined: 31 May 2003
Location: United States
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bullschmidt Quote  Post ReplyReply Direct Link To This Post 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
Classic ASP Design Tips, ASP Web Database Sample (Freely Downloadable)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.