473,803 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disappearing Column Data

I've got some bizarre behavior going on with my ASP code below. For
some strange reason (and I'm a newbie to ASP so it's probably obvious
to others) I can't display all the rows of data from the query. As an
example, the Problem Solution column doesn't display and unless I
comment out another column. Or if I move Problem Solution and it make
ithe first column, then the Root Cause won't display.

Here's the code:

<%
Option Explicit
Dim l_name
Dim prob
Dim rsCustSurvey
Dim raction_summary
Dim Conn
l_name = Request.QuerySt ring("l_name")
prob = Request.QuerySt ring("prob")
' response.write( l_name)

set Conn=Server.Cre ateObject("ADOD B.Connection")
set rsCustSurvey = server.CreateOb ject("ADODB.Rec ordset")
set raction_summary =server.CreateO bject("ADODB.Re cordset")
Conn.open "Driver={SQ L Server};
Server=serverL0 1;Database=mine ;UID=u;PWD=p;"

set rsCustSurvey = conn.Execute ("Select ProblemDescript ionTrunc,
Action_Summary, ProblemItem, Problem_Solutio n002, " _
& " Problem_Descrip tion002, RootCause, LastModifiedBy,
dbo.TTS_Main.As signedGroup, dbo.TTS_Main.La st_Name,
dbo.TTS_Main.Fi rst_Name, " _
& " dbo.TTS_Main.Tr acker, dbo.TTS_Main.St atus,
dbo.TTS_Main.As signedGroup, AssignedTechnic ian, ModificationHis tory "_
& " From tts_main " _
& " Where ProblemDescript ionTrunc LIKE '%" & prob & "%' " _
& " And Last_Name LIKE '%" & l_name & "%' ")

if rsCustSurvey.EO F then 'traps for IF recordset is empty THEN:
Response.Write "There is no data"
Response.End
end if

%>

<table border="1">

<tr>
<td align="center"> <font face="Arial" size="2"><b>Pro blem
Description</font></td>
<td align="center"> <font face="Arial" size="2"><b>Act ion
Summary</font></td>
<td align="center"> <font face="Arial" size="2"><b>Roo t
Cause</font></td>
<td align="center"> <font face="Arial" size="2"><b>Pro blem
Solution</font></td>

</tr>
<%do while not rsCustSurvey.EO F%></do>
<tr>
<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("A ction_Summary") %>
</td>
<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("P roblem_Solution 002")%>
</td>

<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("R ootCause")%>
</td>

<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("A ction_Summary") %>
</td>

</tr>
<%rsCustSurvey. MoveNext%>
<%loop%>

</table>
<%
set rsCustSurvey = nothing
set conn = nothing
%>

Suggestions?

Nov 15 '06 #1
3 2000

<da******@gmail .comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
I've got some bizarre behavior going on with my ASP code below. For
some strange reason (and I'm a newbie to ASP so it's probably obvious
to others) I can't display all the rows of data from the query. As an
example, the Problem Solution column doesn't display and unless I
comment out another column. Or if I move Problem Solution and it make
ithe first column, then the Root Cause won't display.

Here's the code:

<%
Option Explicit
Dim l_name
Dim prob
Dim rsCustSurvey
Dim raction_summary
Dim Conn
l_name = Request.QuerySt ring("l_name")
prob = Request.QuerySt ring("prob")
' response.write( l_name)

set Conn=Server.Cre ateObject("ADOD B.Connection")
set rsCustSurvey = server.CreateOb ject("ADODB.Rec ordset")
set raction_summary =server.CreateO bject("ADODB.Re cordset")
Conn.open "Driver={SQ L Server};
Server=serverL0 1;Database=mine ;UID=u;PWD=p;"

set rsCustSurvey = conn.Execute ("Select ProblemDescript ionTrunc,
Action_Summary, ProblemItem, Problem_Solutio n002, " _
& " Problem_Descrip tion002, RootCause, LastModifiedBy,
dbo.TTS_Main.As signedGroup, dbo.TTS_Main.La st_Name,
dbo.TTS_Main.Fi rst_Name, " _
& " dbo.TTS_Main.Tr acker, dbo.TTS_Main.St atus,
dbo.TTS_Main.As signedGroup, AssignedTechnic ian, ModificationHis tory "_
& " From tts_main " _
& " Where ProblemDescript ionTrunc LIKE '%" & prob & "%' " _
& " And Last_Name LIKE '%" & l_name & "%' ")

Nothing to do with your problem, but why are you selecting all these columns
when you are only using 4 of them in your html?

>
if rsCustSurvey.EO F then 'traps for IF recordset is empty THEN:
Response.Write "There is no data"
Response.End
end if

%>

<table border="1">

<tr>
<td align="center"> <font face="Arial" size="2"><b>Pro blem
Description</font></td>
<td align="center"> <font face="Arial" size="2"><b>Act ion
Summary</font></td>
<td align="center"> <font face="Arial" size="2"><b>Roo t
Cause</font></td>
<td align="center"> <font face="Arial" size="2"><b>Pro blem
Solution</font></td>

</tr>
<%do while not rsCustSurvey.EO F%></do>
<tr>
<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("A ction_Summary") %>
</td>
<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("P roblem_Solution 002")%>
</td>

<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("R ootCause")%>
</td>

<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("A ction_Summary") %>
</td>
</tr>
<%rsCustSurvey. MoveNext%>
<%loop%>
</table>
<%
set rsCustSurvey = nothing
set conn = nothing
%>

Suggestions?
View Source to see if there are any obvious html problems. If you can't see
any, try posting the html source here. That would be my first place to
look.

--
Mike Brind
Nov 15 '06 #2

<da******@gmail .comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
I've got some bizarre behavior going on with my ASP code below. For
some strange reason (and I'm a newbie to ASP so it's probably obvious
to others) I can't display all the rows of data from the query. As an
example, the Problem Solution column doesn't display and unless I
comment out another column. Or if I move Problem Solution and it make
ithe first column, then the Root Cause won't display.

Here's the code:

<%
Option Explicit
Dim l_name
Dim prob
Dim rsCustSurvey
Dim raction_summary
Dim Conn
l_name = Request.QuerySt ring("l_name")
prob = Request.QuerySt ring("prob")
' response.write( l_name)

set Conn=Server.Cre ateObject("ADOD B.Connection")
set rsCustSurvey = server.CreateOb ject("ADODB.Rec ordset")
set raction_summary =server.CreateO bject("ADODB.Re cordset")
Conn.open "Driver={SQ L Server};
Server=serverL0 1;Database=mine ;UID=u;PWD=p;"

set rsCustSurvey = conn.Execute ("Select ProblemDescript ionTrunc,
Action_Summary, ProblemItem, Problem_Solutio n002, " _
& " Problem_Descrip tion002, RootCause, LastModifiedBy,
dbo.TTS_Main.As signedGroup, dbo.TTS_Main.La st_Name,
dbo.TTS_Main.Fi rst_Name, " _
& " dbo.TTS_Main.Tr acker, dbo.TTS_Main.St atus,
dbo.TTS_Main.As signedGroup, AssignedTechnic ian, ModificationHis tory "_
& " From tts_main " _
& " Where ProblemDescript ionTrunc LIKE '%" & prob & "%' " _
& " And Last_Name LIKE '%" & l_name & "%' ")

if rsCustSurvey.EO F then 'traps for IF recordset is empty THEN:
Response.Write "There is no data"
Response.End
end if

%>

<table border="1">

<tr>
<td align="center"> <font face="Arial" size="2"><b>Pro blem
Description</font></td>
<td align="center"> <font face="Arial" size="2"><b>Act ion
Summary</font></td>
<td align="center"> <font face="Arial" size="2"><b>Roo t
Cause</font></td>
<td align="center"> <font face="Arial" size="2"><b>Pro blem
Solution</font></td>

</tr>
<%do while not rsCustSurvey.EO F%></do>
<tr>
<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("A ction_Summary") %>
</td>
<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("P roblem_Solution 002")%>
</td>

<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("R ootCause")%>
</td>

<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("A ction_Summary") %>
</td>

</tr>
<%rsCustSurvey. MoveNext%>
<%loop%>

</table>
<%
set rsCustSurvey = nothing
set conn = nothing
%>

Suggestions?
Put both fields at the end of the set of fields returned in the query.
Read them only after you have read all the other fields you need.
Read them in the order they appear in the recordset
That may mean you need to read fields into temporary variables so that you
can output them in the order you prefer in the table output.

OR

use a readonly, keyset cursor instead of the forward only 'cursor' you are
currently using

OR

stop using text/ntext field types and use varchar(8000)/nvarchar(4000) field
types instead for these fields.
The problem is by default SQL server provider use a forward only recordset
which actually means no recordset at all. The records are read from a TDS
stream almost direct from the query. Once read the record is discarded. If
there are text and other indeterminately long fields ADO needs to move
further along the stream to read them and once it's done that it will drop
some of the data for those fields.

Using a keyset recordset use what is more proper cursor allowing ADO to move
back and forth in the recordset.

BTW.

Don't do this:-

<%rsCustSurvey. MoveNext%>
<%loop%>

Do this:-

<%
rsCustSurvey.Mo veNext
loop
%>

Also note that the font element is deprecated. Put a CSS style element in
the header:-

<style>
td {font-family:arial; font-size:xx-small}
th {font-family:arial; font-sixe:x-small}
</style>

Also use th elements for column headers (th has centered bold as a default
style) and use thead and tbody elements

When sending text content from a DB to a browser you should ensure special
characters such as < and & are properly encoded. The Server.HTMLEnco de
function does that.

<table border="1">
<thead>
<tr>
<th>Problem Description</th>
<th>Action Summary</th>
<th>Root Cause</th>
<th>Problem Solution</th>
</tr>
</thead>
<tbody>
<%

Do Until rsCustSurvey.EO F

%>
<tr>
<td><%=Server.H TMLEncode(rsCus tServer("Action _Summary"))%></td>
<td><%=Server.H TMLEncode(rsCus tServer("Proble m_Solution002") )%></td>
<td><%=Server.H TMLEncode(rsCus tServer("RootCa use"))%></td>
<td><%=Server.H TMLEncode(rsCus tServer("Action _Summary"))%></td>
</tr>
<%

rsCustSurvey.Mo veNext
Loop

%>
</tbody>
</table>
HTH,

Anthony.
Nov 15 '06 #3
Anthony,

Thanks for all the tips. I'm a newbie to both asp and css so your
comments are quite helpful.

Dale
Anthony Jones wrote:
<da******@gmail .comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
I've got some bizarre behavior going on with my ASP code below. For
some strange reason (and I'm a newbie to ASP so it's probably obvious
to others) I can't display all the rows of data from the query. As an
example, the Problem Solution column doesn't display and unless I
comment out another column. Or if I move Problem Solution and it make
ithe first column, then the Root Cause won't display.

Here's the code:

<%
Option Explicit
Dim l_name
Dim prob
Dim rsCustSurvey
Dim raction_summary
Dim Conn
l_name = Request.QuerySt ring("l_name")
prob = Request.QuerySt ring("prob")
' response.write( l_name)

set Conn=Server.Cre ateObject("ADOD B.Connection")
set rsCustSurvey = server.CreateOb ject("ADODB.Rec ordset")
set raction_summary =server.CreateO bject("ADODB.Re cordset")
Conn.open "Driver={SQ L Server};
Server=serverL0 1;Database=mine ;UID=u;PWD=p;"

set rsCustSurvey = conn.Execute ("Select ProblemDescript ionTrunc,
Action_Summary, ProblemItem, Problem_Solutio n002, " _
& " Problem_Descrip tion002, RootCause, LastModifiedBy,
dbo.TTS_Main.As signedGroup, dbo.TTS_Main.La st_Name,
dbo.TTS_Main.Fi rst_Name, " _
& " dbo.TTS_Main.Tr acker, dbo.TTS_Main.St atus,
dbo.TTS_Main.As signedGroup, AssignedTechnic ian, ModificationHis tory "_
& " From tts_main " _
& " Where ProblemDescript ionTrunc LIKE '%" & prob & "%' " _
& " And Last_Name LIKE '%" & l_name & "%' ")

if rsCustSurvey.EO F then 'traps for IF recordset is empty THEN:
Response.Write "There is no data"
Response.End
end if

%>

<table border="1">

<tr>
<td align="center"> <font face="Arial" size="2"><b>Pro blem
Description</font></td>
<td align="center"> <font face="Arial" size="2"><b>Act ion
Summary</font></td>
<td align="center"> <font face="Arial" size="2"><b>Roo t
Cause</font></td>
<td align="center"> <font face="Arial" size="2"><b>Pro blem
Solution</font></td>

</tr>
<%do while not rsCustSurvey.EO F%></do>
<tr>
<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("A ction_Summary") %>
</td>
<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("P roblem_Solution 002")%>
</td>

<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("R ootCause")%>
</td>

<td><font face="Arial" size=1>
<%response.writ e rsCustSurvey("A ction_Summary") %>
</td>

</tr>
<%rsCustSurvey. MoveNext%>
<%loop%>

</table>
<%
set rsCustSurvey = nothing
set conn = nothing
%>

Suggestions?

Put both fields at the end of the set of fields returned in the query.
Read them only after you have read all the other fields you need.
Read them in the order they appear in the recordset
That may mean you need to read fields into temporary variables so that you
can output them in the order you prefer in the table output.

OR

use a readonly, keyset cursor instead of the forward only 'cursor' you are
currently using

OR

stop using text/ntext field types and use varchar(8000)/nvarchar(4000) field
types instead for these fields.
The problem is by default SQL server provider use a forward only recordset
which actually means no recordset at all. The records are read from a TDS
stream almost direct from the query. Once read the record is discarded. If
there are text and other indeterminately long fields ADO needs to move
further along the stream to read them and once it's done that it will drop
some of the data for those fields.

Using a keyset recordset use what is more proper cursor allowing ADO to move
back and forth in the recordset.

BTW.

Don't do this:-

<%rsCustSurvey. MoveNext%>
<%loop%>

Do this:-

<%
rsCustSurvey.Mo veNext
loop
%>

Also note that the font element is deprecated. Put a CSS style element in
the header:-

<style>
td {font-family:arial; font-size:xx-small}
th {font-family:arial; font-sixe:x-small}
</style>

Also use th elements for column headers (th has centered bold as a default
style) and use thead and tbody elements

When sending text content from a DB to a browser you should ensure special
characters such as < and & are properly encoded. The Server.HTMLEnco de
function does that.

<table border="1">
<thead>
<tr>
<th>Problem Description</th>
<th>Action Summary</th>
<th>Root Cause</th>
<th>Problem Solution</th>
</tr>
</thead>
<tbody>
<%

Do Until rsCustSurvey.EO F

%>
<tr>
<td><%=Server.H TMLEncode(rsCus tServer("Action _Summary"))%></td>
<td><%=Server.H TMLEncode(rsCus tServer("Proble m_Solution002") )%></td>
<td><%=Server.H TMLEncode(rsCus tServer("RootCa use"))%></td>
<td><%=Server.H TMLEncode(rsCus tServer("Action _Summary"))%></td>
</tr>
<%

rsCustSurvey.Mo veNext
Loop

%>
</tbody>
</table>
HTH,

Anthony.
Nov 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
810
by: John Dann | last post by:
I have an odd problem with a 2-column page set in a 2-column table. The right-hand column is meant to act like a sidebar and is relatively narrow at 160px. The problem is that the display of some lines of the text content in the sidebar is corrupted (in IE6 under Windows 98 and 2000). There's only text content in this column without any special formatting or tricks. Sometimes part of one line disappears, sometimes a whole paragraph. The...
5
4366
by: lkrubner | last post by:
Except for missing ALT tags on images, this site validates, yet I get some strange disappearing text in IE on a PC. Check out this page: http://www.alexmarshall.org/index.php?pageId=50 At the bottom of the middle box is the text "Categories: About my book", which shows up normally in FireFox, but which disappears in IE. Why so?
2
4095
by: neptune | last post by:
I built a form to access a query with a 2 field primary key. It should use 2 controls to find the unique record and display the other field values on the form. In the criteria section of the query, I set the 2 primary key values equal to the 2 control values on my form. When I input a value to these 2 controls the query finds the correct record, so I know my query with the criteria works. My problem is trying to get the output values...
2
2609
by: Rachel Suddeth | last post by:
Here is my scenario: I have a few custom controls that I set up on a form and tested setting properties and appearances. Then I added a couple references to the project which add classes I need to get data from the server to actually do something useful. (These are generated by 3rd party database software.) After adding those references, and no other changes to my form.... all the controls disappear from the visual interface on the...
6
1643
by: Winshent | last post by:
I have read many threads which indicate that this was a problem with version 2002. Why should i be suffering this? I am using VB.NET 2003 Standard Edition... is it still a problem with 2003? I have used the wizards to generate the connection and adapter, which generates the code in 'InitializeComponent', and i have stored the connection string within web.config and it seems to get rid of this
0
1097
by: Patrick | last post by:
I am using VB to implement a code behind class for an ASP.NET form. I am loading a DataGrid web server control with data from a table in a SQL database. the code is as follows: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here If Not Page.IsPostBack Then Dim con As SqlConnection = New SqlConnection
4
1887
by: c676228 | last post by:
Hi all, the data disappearing problem occurs to all my controls even my regualr web control like asp:textbox, when I click back button in web browser from second page to first page and then click continue button on the first page to second page again, all the data entered , even in web server control(not user controls defined by myself.) all disappear. What's going on. I thought dealing with .net should be much easier, did I miss...
0
2009
by: Don Miller | last post by:
Here is an example of what I believe is a bug in ASP.NET 2.0 GridView paging without postbacks (or at least not documented how to fix it). Once the GridView is displayed, clicking on any of the paging tools causes the GridView to completely disappear! This happens when either DataSets or DataTables are used (it doesn't work at all for DataReaders because they don't support paging apparently). If you remove the...
4
2730
by: Don Miller | last post by:
This is a repost of a reproducible problem/bug with GridView with dynamic SQL and binding. Is there a better ASP.NET newsgroup I should post to where MS techs or MVPs take an interest in such problems? Thanks. Here is an example of what I believe is a bug in ASP.NET 2.0 GridView paging without postbacks (or at least not documented how to fix it). Once the GridView is displayed, clicking on any of the paging tools causes the
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10289
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7600
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.