Querystring and Numeric Value Problem

Results 1 to 2 of 2

Thread: Querystring and Numeric Value Problem

  1. #1
    Join Date
    Dec 1969

    Default Querystring and Numeric Value Problem

    Hi,<BR><BR>This will be easy for most of you guys.<BR><BR>How do you run a query on a querystring numerical value??<BR><BR>dMemberID = Request.QueryString("ID")&#060;---This value is being passed OK, as a number ie: 2<BR><BR>strQ = "SELECT * FROM tblMembers"<BR>strQ = strQ & "WHERE tID =&#039;"& dMemberID &"&#039;<BR>Set rsMembers = Conn.Execute(strQ)<BR><BR>Thanks <BR><BR>Darrell...

  2. #2
    Join Date
    Dec 1969

    Default Nothing to do with querystring...

    ...everything to do with SQL.<BR><BR>You *NEVER* put &#039;...&#039; around numerical values in SQL.<BR><BR>Your SQL is also bogus because you have no space between the table name and the keyword WHERE, so the SQL processor thinks you are trying to use a table named<BR> tblMembersWHERE<BR>and of course there is no such table. Kablooey.<BR><BR>You really should learn to debug your code:<BR>&#060;%<BR>...<BR>strQ = "SELECT * FROM tblMembers WHERE tID = " & dMemberID <BR>Response.Write "DEBUG: SQL is " & strQ & "&#060;HR&#062;"<BR>...<BR>%&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts