Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Thanked 4 Times in 4 Posts

    Variable is being passed wrong RESOLVED (nevermind).

    I am opening an asp and passing a record ID with the request. When it gets to the SQL statement the variable has extra quotes around it causing it not to be in the recordset.

    http//blah blah blah/debug.asp?EvtID="NKA82947222004"

       strEvtID = request.querystring("EvtID")
       response.write "In program<br>"
       if strEvtID <> "" then
          'See if it is a draft by looking for this in the drafts table.
    	  strSQL = "SELECT * FROM Drafts WHERE EventID='" & strEvtID & "'"
    	  	vSQL = "Select * from qryApprovers where UserID='" & strMyUID & "';"
    	  Response.write "strSQL = " & strSQL & "<br>"
    	  Response.write "vSQL = " & vSQL & "<br>"
    I put the vSQL in to check another line from another page I had written. It comes out right. The strSQL doesn't!

    In the browser this is what I get;

    In program
    strSQL = SELECT * FROM Drafts WHERE EventID='"NKA8294Jul222004"'
    vSQL = Select * from qryApprovers where UserID='NKA8294';

    When I removed the quotes from the query string I got another error, fixed that error and the call ran right without the quotes. Just overloked stuff. Thanks.
    Thanks for the help,
    Last edited by ScottInTexas; 07-22-2004 at 06:17 PM. Reason: Resolved The Problem
    Scott Stewart
    Always happy to learn from pros.


Posting Permissions

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