Urgent: Strange ASP behavior

Results 1 to 4 of 4

Thread: Urgent: Strange ASP behavior

  1. #1
    Join Date
    Dec 1969
    Posts
    46

    Default Urgent: Strange ASP behavior

    This is driving me nuts! Here it is..<BR>Page1 posts a single field form to Page2, Page2 opens a connection to SQL Server to retrieve all records containing an integer value("SELECT * FROM myTable WHERE myNumber = 12345").<BR>If the Recordset bring anything back, the page loads and displays fine; if it doesn&#039t find any records, a completely blank page loads with absolutely nothing on it. Not even any of the raw HTML. Please help..!

  2. #2
    Richard L. Guest

    Default Post Code pls.

    I&#039ll give it a shot if you post your code...

  3. #3
    Join Date
    Dec 1969
    Posts
    46

    Default RE: Post Code pls.

    Page1:<BR>&#060;form action="Page2.asp" method="post"&#062;<BR>&#060;input type="text" name="DOC_NUMBER" size="11" maxlength="6"&#062;<BR>&#060;/form&#062;<BR>----------------------------------------<BR>Page2:<BR>&#060;%<BR>Response.Buffer = "true"<BR> <BR>If session("LOGGEDIN") = "" Then<BR> response.redirect "default.asp"<BR>End If<BR> <BR>Set cn = Server.CreateObject("ADODB.Connection")<BR>Set rRS = Server.CreateObject("ADODB.Recordset")<BR><BR>cn.o pen "dsn","uid","pwd"<BR><BR>rSQL = "SELECT * FROM documents WHERE DOC_NUMBER = " & <BR> Request.Form("DOC_NUMBER")<BR>rRS.Open rSQL,cn,1,1<BR>%&#062;<BR>...a whole bunch of html<BR>&#060;% If NOT rRS.EOF Then %&#062;<BR> ...display doc details<BR>&#060;% Else %&#062;<BR> ...display message that doc was not found<BR>&#060;% End If %&#062;<BR>==================<BR>If you enter a valid DOC_NUMBER on Page1 then the &#039IF&#039 part in Page2 gets executed and data is displayed; however if you enter a DOC_NUMBER that does not exist in the db table then not only the &#039ELSE&#039 doesn&#039t get executed but the page comes up completely blank. What could be causing this?<BR>

  4. #4
    ActiveALLI OZ.COM Guest

    Default RE: Post Code pls.

    You sould try .<BR><BR>&#060;% If rRS.BOF or rRS.EOF Then %&#062;<BR>...display message that doc was not found<BR>&#060;% Else %&#062;<BR>...display doc details<BR>&#060;% End If %&#062;<BR><BR>


Posting Permissions

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