Response.write strsql does not yield desired sql statement

Discussion in 'ASP General' started by Jack, Nov 19, 2004.

  1. Jack

    Jack Guest

    Hi,
    I am trying to check for the final sql statement before passing it to a
    database. I want to build the statement using user input in three text boxes.
    However, the sql statement does not give me the right statement. Instead it
    gives the following message:
    Error Type:
    Request object, ASP 0102 (0x80004005)
    The function expects a string as input.
    /sailors/loginverification1.asp, line 14
    CODE:
    <%
    strSQL = "select PeopleNameFirst, PeopleNameLast, PeopleClubCode from People
    where " & _
    "PeopleNameFirst ='" & Request.Form(txtFirstName) & "' AND " & _
    "PeopleNameLat ='" & Request.Form(txtLastName) & "' AND " & _
    "PeopleClubCode ='" & Request.Form(txtPassword) & "'"
    Response.Write strSQL
    %>
    Please note that line 14 is the first statement in above sql. Looking for
    any advise on where the problem of the sql is. Thanks.
     
    Jack, Nov 19, 2004
    #1
    1. Advertising

  2. Jack

    Jeff Dillon Guest

    Should be Request.Form("txtFirstName")

    (in quotes)


    "Jack" <> wrote in message
    news:D...
    > Hi,
    > I am trying to check for the final sql statement before passing it to a
    > database. I want to build the statement using user input in three text

    boxes.
    > However, the sql statement does not give me the right statement. Instead

    it
    > gives the following message:
    > Error Type:
    > Request object, ASP 0102 (0x80004005)
    > The function expects a string as input.
    > /sailors/loginverification1.asp, line 14
    > CODE:
    > <%
    > strSQL = "select PeopleNameFirst, PeopleNameLast, PeopleClubCode from

    People
    > where " & _
    > "PeopleNameFirst ='" & Request.Form(txtFirstName) & "' AND " & _
    > "PeopleNameLat ='" & Request.Form(txtLastName) & "' AND " & _
    > "PeopleClubCode ='" & Request.Form(txtPassword) & "'"
    > Response.Write strSQL
    > %>
    > Please note that line 14 is the first statement in above sql. Looking for
    > any advise on where the problem of the sql is. Thanks.
     
    Jeff Dillon, Nov 19, 2004
    #2
    1. Advertising

  3. Jack

    Jack Guest

    Thanks for pointing out the mistake. I overlooked it altoghther. Regards.

    "Jeff Dillon" wrote:

    > Should be Request.Form("txtFirstName")
    >
    > (in quotes)
    >
    >
    > "Jack" <> wrote in message
    > news:D...
    > > Hi,
    > > I am trying to check for the final sql statement before passing it to a
    > > database. I want to build the statement using user input in three text

    > boxes.
    > > However, the sql statement does not give me the right statement. Instead

    > it
    > > gives the following message:
    > > Error Type:
    > > Request object, ASP 0102 (0x80004005)
    > > The function expects a string as input.
    > > /sailors/loginverification1.asp, line 14
    > > CODE:
    > > <%
    > > strSQL = "select PeopleNameFirst, PeopleNameLast, PeopleClubCode from

    > People
    > > where " & _
    > > "PeopleNameFirst ='" & Request.Form(txtFirstName) & "' AND " & _
    > > "PeopleNameLat ='" & Request.Form(txtLastName) & "' AND " & _
    > > "PeopleClubCode ='" & Request.Form(txtPassword) & "'"
    > > Response.Write strSQL
    > > %>
    > > Please note that line 14 is the first statement in above sql. Looking for
    > > any advise on where the problem of the sql is. Thanks.

    >
    >
    >
     
    Jack, Nov 19, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    394
    Eliyahu Goldin
    Jan 18, 2007
  2. Frank
    Replies:
    2
    Views:
    274
    Frank
    Jul 29, 2005
  3. Replies:
    1
    Views:
    332
    Gabriel Genellina
    Apr 22, 2008
  4. Markus
    Replies:
    1
    Views:
    210
    Mark Hubbart
    Sep 27, 2004
  5. Michael Edgar
    Replies:
    13
    Views:
    286
    Brian Candler
    Apr 21, 2011
Loading...

Share This Page