Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: No Browser Output


Message #1 by Leo Clayton <claytonl@z...> on Tue, 21 Nov 2000 18:09:51 -0500
--=====================_379373009==_.ALT

Content-Type: text/plain; charset="us-ascii"; format=flowed



I am trying SELECT some fields from a TABLE and write them to my browser, 

but the only Output that I get are my headings.



Browser output:

EMPLOYEE MASTER DATABASE

               UPDATING THE EMPLOYEE TABLE



Source code:

<% @LANGUAGE = "VBSCRIPT" %>



<% Response.Buffer = True %>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<HTML>

<HEAD>



<TITLE>UPDATING THE EMPLOYEE TABLE</TITLE>

</HEAD>



<BODY BGCOLOR="FFFF80">

<CENTER>

<H1>EMPLOYEE MASTER DATABASE<BR>

UPDATING THE EMPLOYEE TABLE</H1>

</CENTER>



<%

  strSQL = "SELECT * FROM EmployeeTable;"

Set DbObj = Server.CreateObject("ADODB.CONNECTION")

DbObj.Open "DSN=EmployeeMaster"

Set oRs = DbObj.Execute(strSQL)

%>



<%

Response.Write ("The File Selected To Be Updated is ")

Response.Write Request.Form("TableToBeUpdated")

%>

If Request.Form("TableToBeUpdated") = "Employee" Then

<TABLE BORDER=3>

<% WHILE NOT oRs.EOF %>

<TR>

<TD>    <% =rs.Fields("FirstName").Value %>     </TD>

</TR>

<TR>

<TD>    <% =rs.Fields ("LastName").Value %>     </TD>

</TR>

<TR>

<TD>    <% =rs.Fields ("Title").Value %>        </TD>

</TR>

<TR>

<TD>    <% =rs.Fields ("Education").Value %>    </TD>

</TR>

<TR>

<TD>    <% =rs.Fields ("JobHistory").Value %>   </TD>

</TR>

<% WEND %>

</Table>



'       Response.Redirect "SelectFieldsToUpdate.asp"

'Else

'Response.Redirect "UpdateEmployeeSkillsTable.asp"

'End If

End If

%>







'%>



</BODY>

</HTML>



Can someone please tell me what I am doing wrong!








Message #2 by "jigs gandhi" <newsgroup@h...> on Wed, 22 Nov 2000 14:18:06 +0530
This is a multi-part message in MIME format.



------=_NextPart_000_088F_01C0548F.08A10240

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



HI,



There is no rs.MoveNext in your code.

I am sure this must be putting the IIS server into infinite loop :-)



One more thing



If Request.Form("TableToBeUpdated") =3D "Employee" Then



you want to display the table only if above condition is satisfied. so 

what i suggest that you open the connection and the recordset inside the 

IF statement. This will save your server resources



jigs



  ----- Original Message -----

  From: Leo Clayton

  To: ASP Databases

  Sent: Wednesday, November 22, 2000 8:55 PM

  Subject: [asp_databases] No Browser Output





  

--=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D_3793730

09=3D=3D_.ALT

  Content-Type: text/plain; charset=3D"us-ascii"; format=3Dflowed



  I am trying SELECT some fields from a TABLE and write them to my 

browser,

  but the only Output that I get are my headings.



  Browser output:

  EMPLOYEE MASTER DATABASE

                 UPDATING THE EMPLOYEE TABLE



  Source code:

  <% @LANGUAGE =3D "VBSCRIPT" %>



  <% Response.Buffer =3D True %>



  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

  <HTML>

  <HEAD>



  <TITLE>UPDATING THE EMPLOYEE TABLE</TITLE>

  </HEAD>



  <BODY BGCOLOR=3D"FFFF80">

  <CENTER>

  <H1>EMPLOYEE MASTER DATABASE<BR>

  UPDATING THE EMPLOYEE TABLE</H1>

  </CENTER>



  <%

    strSQL =3D "SELECT * FROM EmployeeTable;"

  Set DbObj =3D Server.CreateObject("ADODB.CONNECTION")

  DbObj.Open "DSN=3DEmployeeMaster"

  Set oRs =3D DbObj.Execute(strSQL)

  %>



  <%

  Response.Write ("The File Selected To Be Updated is ")

  Response.Write Request.Form("TableToBeUpdated")

  %>

  If Request.Form("TableToBeUpdated") =3D "Employee" Then

  <TABLE BORDER=3D3>

  <% WHILE NOT oRs.EOF %>

  <TR>

  <TD>    <% =3Drs.Fields("FirstName").Value %>     </TD>

  </TR>

  <TR>

  <TD>    <% =3Drs.Fields ("LastName").Value %>     </TD>

  </TR>

  <TR>

  <TD>    <% =3Drs.Fields ("Title").Value %>        </TD>

  </TR>

  <TR>

  <TD>    <% =3Drs.Fields ("Education").Value %>    </TD>

  </TR>

  <TR>

  <TD>    <% =3Drs.Fields ("JobHistory").Value %>   </TD>

  </TR>

  <% WEND %>

  </Table>



  '       Response.Redirect "SelectFieldsToUpdate.asp"

  'Else

  'Response.Redirect "UpdateEmployeeSkillsTable.asp"

  'End If

  End If

  %>







  '%>





  --- <BR>

  NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?<BR>

  Visit EarthWeb for the latest in IT Management, Software Development, 

<BR>

  Web Development, Networking & Communications, and Hardware & 

Systems.  <BR>

  Click on http://www.earthweb.com for FREE articles, tutorials,<BR>

  and discussions from the experts.<BR>

  ---<BR>


newsgroup@h...<BR>


$subst('Email.Unsub')<BR>



  </BODY>

  </HTML>



  Can someone please tell me what I am doing wrong!





  

--=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D_3793730

09=3D=3D_.ALT

  Content-Type: text/html; charset=3D"us-ascii"





  <html>

  I am trying SELECT some fields from a TABLE and write them to my 

browser,

  but the only Output that I get are my headings.<br>

  <br>

  Browser output:<br>

  EMPLOYEE MASTER DATABASE<br>

  

            &

nbsp;

  UPDATING THE EMPLOYEE TABLE<br>

  <br>

  Source code:<br>

  <font size=3D2><% @LANGUAGE =3D "VBSCRIPT" %><br>

  <br>

  <% Response.Buffer =3D True %><br>

  <br>

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2

  Final//EN"><br>

  <HTML><br>

  <HEAD><br>

  <br>

  <TITLE>UPDATING THE EMPLOYEE TABLE</TITLE><br>

  </HEAD><br>

  <br>

  <BODY BGCOLOR=3D"FFFF80"><br>

  <CENTER><br>

  <H1>EMPLOYEE MASTER DATABASE<BR><br>

  UPDATING THE EMPLOYEE TABLE</H1><br>

  </CENTER><br>

  <br>

  <%<br>

   strSQL =3D "SELECT * FROM EmployeeTable;"<br>

  Set DbObj =3D Server.CreateObject("ADODB.CONNECTION")<br>

  DbObj.Open "DSN=3DEmployeeMaster"<br>

  Set oRs =3D DbObj.Execute(strSQL)<br>

  %><br>

    <br>

  <%<br>

  Response.Write ("The File Selected To Be Updated is ")<br>

  Response.Write Request.Form("TableToBeUpdated")<br>

  %> <br>

  If Request.Form("TableToBeUpdated") =3D "Employee"

  Then<br>

  <TABLE BORDER=3D3><br>

  <% WHILE NOT oRs.EOF %><br>

  <TR><br>

  <TD><x-tab>    </x-tab><%

  =3Drs.Fields("FirstName").Value %> 

  <x-tab>   </x-tab></TD><br>

  </TR><br>

  <TR><br>

  <TD><x-tab>    </x-tab><% =3Drs.Fields

  ("LastName").Value %>

  <x-tab>    </x-tab></TD><br>

  </TR><br>

  <TR><br>

  <TD><x-tab>    </x-tab><% =3Drs.Fields

  ("Title").Value %>

  

<x-tab>       </x-tab></TD><br>

  </TR><br>

  <TR><br>

  <TD><x-tab>    </x-tab><% =3Drs.Fields

  ("Education").Value

  %><x-tab>    </x-tab></TD><br>

  </TR><br>

  <TR><br>

  <TD><x-tab>    </x-tab><% =3Drs.Fields

  ("JobHistory").Value

  %><x-tab>   </x-tab></TD><br>

  </TR><br>

  <% WEND %><br>

  </Table><br>

  <br>

  

'<x-tab>       </x-tab>Response.Redire

ct

  "SelectFieldsToUpdate.asp"<br>

  'Else<br>

  'Response.Redirect "UpdateEmployeeSkillsTable.asp"<br>

  'End If<br>

  End If<br>

  %><br>

  <br>

  <br>

  <br>

  '%><br>

  <br>

  </BODY><br>

  </HTML><br>

  <br>

  Can someone please tell me what I am doing wrong!<br>

  <br>

  </font></html>



  

--=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D_3793730

09=3D=3D_.ALT--












Message #3 by "Dallas Martin" <dmartin@z...> on Wed, 22 Nov 2000 20:51:40 -0500
Change the reference to the recordset fields to "rs("FirstName")" syntax .

Also, you need to include the "If Request.Form("TableToBeUpdated") 

"Employee" Then"

line inside the ASP delimiters.



Set "Response.Buffer = False", this will cause the server to send the page

in increments instead

of formatting the entire page first.



Lastly, you never move off the first recordset. Thus with "buffering"

enabled the server is looping

around the first record and buffering a huge page in memory. You must issue

a "rs.MoveNext"

at the bottom of your loop.







----- Original Message -----

From: "Leo Clayton" <claytonl@z...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, November 22, 2000 10:25 AM

Subject: [asp_databases] No Browser Output





> --=====================_379373009==_.ALT

> Content-Type: text/plain; charset="us-ascii"; format=flowed

>

> I am trying SELECT some fields from a TABLE and write them to my browser,

> but the only Output that I get are my headings.

>

> Browser output:

> EMPLOYEE MASTER DATABASE

>                UPDATING THE EMPLOYEE TABLE

>

> Source code:

> <% @LANGUAGE = "VBSCRIPT" %>

>

> <% Response.Buffer = True %>

>

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

> <HTML>

> <HEAD>

>

> <TITLE>UPDATING THE EMPLOYEE TABLE</TITLE>

> </HEAD>

>

> <BODY BGCOLOR="FFFF80">

> <CENTER>

> <H1>EMPLOYEE MASTER DATABASE<BR>

> UPDATING THE EMPLOYEE TABLE</H1>

> </CENTER>

>

> <%

>   strSQL = "SELECT * FROM EmployeeTable;"

> Set DbObj = Server.CreateObject("ADODB.CONNECTION")

> DbObj.Open "DSN=EmployeeMaster"

> Set oRs = DbObj.Execute(strSQL)

> %>

>

> <%

> Response.Write ("The File Selected To Be Updated is ")

> Response.Write Request.Form("TableToBeUpdated")

> %>

> If Request.Form("TableToBeUpdated") = "Employee" Then

> <TABLE BORDER=3>

> <% WHILE NOT oRs.EOF %>

> <TR>

> <TD>    <% =rs.Fields("FirstName").Value %>     </TD>

> </TR>

> <TR>

> <TD>    <% =rs.Fields ("LastName").Value %>     </TD>

> </TR>

> <TR>

> <TD>    <% =rs.Fields ("Title").Value %>        </TD>

> </TR>

> <TR>

> <TD>    <% =rs.Fields ("Education").Value %>    </TD>

> </TR>

> <TR>

> <TD>    <% =rs.Fields ("JobHistory").Value %>   </TD>

> </TR>

> <% WEND %>

> </Table>

>

> '       Response.Redirect "SelectFieldsToUpdate.asp"

> 'Else

> 'Response.Redirect "UpdateEmployeeSkillsTable.asp"

> 'End If

> End If

> %>

>

>

>

> '%>

>

>

> --- <BR>

> NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?<BR>

> Visit EarthWeb for the latest in IT Management, Software Development, <BR>

> Web Development, Networking & Communications, and Hardware &

Systems.  <BR>

> Click on http://www.earthweb.com for FREE articles, tutorials,<BR>

> and discussions from the experts.<BR>

> ---<BR>

> You are currently subscribed to asp_databases as: dmartin@z...<BR>


$subst('Email.Unsub')<BR>

>

> </BODY>

> </HTML>

>

> Can someone please tell me what I am doing wrong!

>

>

> --=====================_379373009==_.ALT

> Content-Type: text/html; charset="us-ascii"

>

> <html>

> I am trying SELECT some fields from a TABLE and write them to my browser,

> but the only Output that I get are my headings.<br>

> <br>

> Browser output:<br>

> EMPLOYEE MASTER DATABASE<br>

>

            &nbs

p;

> UPDATING THE EMPLOYEE TABLE<br>

> <br>

> Source code:<br>

> <font size=2><% @LANGUAGE = "VBSCRIPT" %><br>

> <br>

> <% Response.Buffer = True %><br>

> <br>

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2

> Final//EN"><br>

> <HTML><br>

> <HEAD><br>

> <br>

> <TITLE>UPDATING THE EMPLOYEE TABLE</TITLE><br>

> </HEAD><br>

> <br>

> <BODY BGCOLOR="FFFF80"><br>

> <CENTER><br>

> <H1>EMPLOYEE MASTER DATABASE<BR><br>

> UPDATING THE EMPLOYEE TABLE</H1><br>

> </CENTER><br>

> <br>

> <%<br>

>  strSQL = "SELECT * FROM EmployeeTable;"<br>

> Set DbObj = Server.CreateObject("ADODB.CONNECTION")<br>

> DbObj.Open "DSN=EmployeeMaster"<br>

> Set oRs = DbObj.Execute(strSQL)<br>

> %><br>

>   <br>

> <%<br>

> Response.Write ("The File Selected To Be Updated is ")<br>

> Response.Write Request.Form("TableToBeUpdated")<br>

> %> <br>

> If Request.Form("TableToBeUpdated") = "Employee"

> Then<br>

> <TABLE BORDER=3><br>

> <% WHILE NOT oRs.EOF %><br>

> <TR><br>

> <TD><x-tab>    </x-tab><%

> =rs.Fields("FirstName").Value %> 

> <x-tab>   </x-tab></TD><br>

> </TR><br>

> <TR><br>

> <TD><x-tab>    </x-tab><% =rs.Fields

> ("LastName").Value %>

> <x-tab>    </x-tab></TD><br>

> </TR><br>

> <TR><br>

> <TD><x-tab>    </x-tab><% =rs.Fields

> ("Title").Value %>

> <x-tab>       </x-tab></TD><br>

> </TR><br>

> <TR><br>

> <TD><x-tab>    </x-tab><% =rs.Fields

> ("Education").Value

> %><x-tab>    </x-tab></TD><br>

> </TR><br>

> <TR><br>

> <TD><x-tab>    </x-tab><% =rs.Fields

> ("JobHistory").Value

> %><x-tab>   </x-tab></TD><br>

> </TR><br>

> <% WEND %><br>

> </Table><br>

> <br>

>

'<x-tab>       </x-tab>Response.Redirect

> "SelectFieldsToUpdate.asp"<br>

> 'Else<br>

> 'Response.Redirect "UpdateEmployeeSkillsTable.asp"<br>

> 'End If<br>

> End If<br>

> %><br>

> <br>

> <br>

> <br>

> '%><br>

> <br>

> </BODY><br>

> </HTML><br>

> <br>

> Can someone please tell me what I am doing wrong!<br>

> <br>

> </font></html>

>

> --=====================_379373009==_.ALT--

>




  Return to Index