[thelist] SQL text form box

Joshua Olson joshua at alphashop.net
Tue Jun 26 23:41:13 CDT 2001


The only thing that glares at me (I'm no ASP guru) is that the variable
references to varLastName and varFirstName within the actual sql statement
need to be pulled out from the string so they can be parsed.

Thus

sql = "SELECT People.PeopleNameLast, " & _
:                "People.PeopleNameFirst, " & _
:                "People.PeopleClubCode " & _
:   "FROM People " & _
:   "WHERE (((People.PeopleNameLast)='varLastName') AND
: ((People.PeopleNameFirst)='varFirstName'));"

becomes:

sql = "SELECT People.PeopleNameLast, " & _
:                "People.PeopleNameFirst, " & _
:                "People.PeopleClubCode " & _
:   "FROM People " & _
:   "WHERE (((People.PeopleNameLast)='" & varLastName & "') AND
: ((People.PeopleNameFirst)='" & varFirstName &"'));"

----- Original Message -----
From: "Daniel S. O'Shea" <doshea at surfree.com>
Subject: [thelist] SQL text form box


: Stumped on a WROX ASP Databases SQL query. I get the return page, no
errors,
: it connects to DB, but even typing in a correct first name and last name
in
: the DB returns no records. The page's <h2> shows up, but no database
: results. I altered the SELECT statement as the original code was for a
: 'dates between' query.
:
: Trying to recreate a text box query. Here's the form (stripped of some
: code):






More information about the thelist mailing list