Building SQL Statements

Results 1 to 3 of 3

Thread: Building SQL Statements

  1. #1
    Navtej Singh Guest

    Default Building SQL Statements

    I am building an SQL statement using input from a text box. How do I get the user input into the SQL query? I tried:<BR><BR>1) ChkString(Request.Form("txtfirstname"))<BR>2) I tried taking the above request and putting it in a variable, then calling the variable<BR>ex: where = &#039;strfirstname&#039;<BR><BR>I am confused about this. It is killing me because I&#039;m pretty sure it is something small that I overlooked, or am doing wrong. Any input would be great.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Building SQL Statements

    your where clause is missing the field name that u want to check ur variable against, the sql should be like this(eg.):<BR>"select * from tablename where name = &#039;" & request("name") & "&#039;"<BR>-----------get the idea.

  3. #3
    Navtej Singh Guest

    Default RE: Building SQL Statements

    vineet, you are the man! Thanks!

Posting Permissions

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