Help

Results 1 to 2 of 2

Thread: Help

  1. #1
    Join Date
    Dec 1969
    Posts
    83

    Default Help

    : &#060;%@ Language=VBScript &#037;&#062;<BR><BR>&#060;%<BR>&#039Create Objects<BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR><BR>&#0 39 Open the connection<BR>Conn.Open "Ameur"<BR><BR>&#039Get Values<BR>ssn = Request.QueryString("EESSN")<BR><BR>SQLtemp = " select * FROM AE " & _ <BR>"WHERE EESSN = &#039" & ssn & "&#039"<BR><BR>set rs=Conn.execute(SQLtemp)<BR>if rs.eof then<BR>str = Server.URLEncode("No record")<BR>Response.Redirect("Response.asp?messag e=" & str)<BR>else<BR>name = rs("FIRSTNAME")<BR>rs.close<BR>Conn.close<BR><BR>e nd if<BR><BR>Please correct my code<BR>when a user submit an html form where he entred his EESSN to display his information, the asp page dispalyed, mY problem is I did the code but when I browsw no record was displayed can you help please.

  2. #2
    Ben Jones Guest

    Default RE: Help

    &#060;%<BR><BR>ssn = Request.QueryString("EESSN")<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Op en "Ameur"<BR><BR><BR>sSQL = "SELECT firstname FROM ae WHERE eessn = &#039" & ssn & "&#039"<BR>SET RS = Conn.execute(sSQL)<BR><BR>dbHits = 0<BR>do while RS.EOF = FALSE<BR> user_name = RS("firstname")<BR> dbHits = dbHits + 1<BR> RS.moveLast<BR>loop<BR><BR><BR>if dbHits = 0 then<BR> response.redirect("response.asp?message=" & Server.URLEncode("No record"))<BR>else<BR> response.write "The name is " & user_name & "."<BR>end if<BR><BR><BR>Conn.Close<BR>set RS = nothing<BR>set Conn = nothing<BR><BR>&#037;&#062;

Posting Permissions

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