Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

not all requested data displayed

Status
Not open for further replies.

sharonc

Programmer
Jan 16, 2001
189
0
0
US
I have an Active Server page built with Macromedia Dreamweaver. It is supposed to display 17 columns of data. rs.source = Select * from OMTenyearProjects
I know there is data on the SQL Server in table OMTenYearProjects

Columns 1-4, 6-8, 13, and 16 all show data, but the other columns are blank.

Does anyone know what might cause this problem?
 
is there content in all 17 fields of this table?

Can you show us your code please - Although since you've said it is DreamWeaver I reckon I'm going to regret asking :)

Tony
________________________________________________________________________________
 
yes there is content in all 17 fields.

Here is the code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/rs.asp" -->

<%
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_rs_STRING

rs.Source = "SELECT * FROM [OMTenYearProjects]"

rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()

rs_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rs_numRows = rs_numRows + Repeat1__numRows
%>
<%
rs_first = rs_total
If (rs_last > rs_total) Then
rs_last = rs_total
End If
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim rs_total
Dim rs_first
Dim rs_last

' set the record count
rs_total = rs.RecordCount

' set the number of rows displayed on this page
If (rs_numRows < 0) Then
rs_numRows = rs_total
Elseif (rs_numRows = 0) Then
rs_numRows = 1
End If

' set the first and last displayed record
rs_first = 1
rs_last = rs_first + rs_numRows - 1

' if we have the correct record count, check the other stats
If (rs_total <> -1) Then
If (rs_first > rs_total) Then
rs_first = rs_total
End If
If (rs_last > rs_total) Then
rs_last = rs_total
End If
If (rs_numRows > rs_total) Then
rs_numRows = rs_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (rs_total = -1) Then

' count the total records by iterating through the recordset
rs_total=0
While (Not rs.EOF)
rs_total = rs_total + 1
rs.MoveNext
Wend

' reset the cursor to the beginning
If (rs.CursorType > 0) Then
rs.MoveFirst
Else
rs.Requery
End If

' set the number of rows displayed on this page
If (rs_numRows < 0 Or rs_numRows > rs_total) Then
rs_numRows = rs_total
End If

' set the first and last displayed record
rs_first = 1
rs_last = rs_first + rs_numRows - 1

If (rs_first > rs_total) Then
rs_first = rs_total
End If
If (rs_last > rs_total) Then
rs_last = rs_total
End If

End If
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<html>
<head>
<title>Display Search Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#ECFFFF">
<table width="92%" border="0">
<tr>
<td width="55%" height="51"><u><strong><font face="Tahoma"><font size="4">Apache Projects O&amp;M
10 Year Report</font></font></strong></u></td>
<td width="45%">&nbsp;</td>
</tr>
</table>

<%
While ((Repeat1__numRows <> 0) AND (NOT rs.EOF))
%>
<table width="98%" height="120" border="1" bgcolor="#ECFFFF">
<tr>
<td width="4%"><strong><font size="2"><u>Req. Date</u></font></strong></td>
<td width="7%"><font size="2"><strong><u>Originator</u></strong></font></td>
<td width="9%"><font size="2"><strong><u>Engineer</u></strong></font></td>
<td width="4%"><font size="2"><strong><u>Type</u></strong></font></td>
<td width="5%"><font size="2"><strong><u>Est. Costs</u></strong></font></td>
<td width="5%"><font size="2"><strong><u>AS of Date</u></strong></font></td>
<td width="5%"><font size="2"><strong><u>Location</u></strong></font></td>
<td width="5%"><font size="2"><strong><u>Equip</u></strong></font></td>
<td width="5%"><font size="2"><strong><u>Work Order</u></strong></font></td>
<td width="4%"><strong><font size="2"><u>Status</u></font></strong></td>
<td width="4%"><strong><font size="2"><u>Mod</u></font></strong></td>
<td width="5%"><strong><font size="2"><u>Outage</u></font></strong></td>
<td width="5%"><strong><font size="2"><u>Priority</u></font></strong></td>
<td width="4%"><strong><font size="2"><u>Plan Year</u></font></strong></td>
<td width="6%"><strong><font size="2"><u>Date Comp</u></font></strong></td>
<td width="9%"><strong><font size="2"><u>Cost Centers</u></font></strong></td>
<td width="12%"><strong><font size="2"><u>Budget Purpose</u></font></strong></td>
</tr>
<tr>
<td><font size="2"><%=(rs.Fields.Item("RequestDate").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("Originator").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("Engineer").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("ProjectType").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("EstCosts").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("AsofDate").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("Location").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("EquipNbr").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("WorkOrder").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("ProjectStatus").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("Modification").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("OutageRequired").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("Priority").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("PlanYear").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("DateCompleted").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("CostCenters").Value)%></font></td>
<td><font size="2"><%=(rs.Fields.Item("BudgetPurpose").Value)%></font></td>
</tr>
<tr>
<td><strong><font size="2"><u>Description</u></font></strong></td>
<td colspan="16"><font size="2"><%=(rs.Fields.Item("Description").Value)%>
</font></td>
</tr>
<tr>
<td><strong><u><font size="2">Action/Items</font></u></strong></td>
<td colspan="16"><font size="2"><%=(rs.Fields.Item("ActionItems").Value)%></font></td>
</tr>
<tr>
<td><strong><font size="2"><u>Notes</u></font></strong></td>
<td colspan="16"><font size="2"><%=(rs.Fields.Item("Notes").Value)%></font></td>
</tr>
<tr>
<td colspan="17">&nbsp;</td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs.MoveNext()
Wend
%>
</p>
<p>&nbsp;</p>
</body>
</html>
<%
rs.Close()
Set rs = Nothing
%>
 
5: (rs.Fields.Item("EstCosts").Value)
9: (rs.Fields.Item("WorkOrder").Value)
10: (rs.Fields.Item("ProjectStatus").Value)
11: (rs.Fields.Item("Modification").Value)
12: (rs.Fields.Item("OutageRequired").Value)
14: (rs.Fields.Item("PlanYear").Value)
15: (rs.Fields.Item("DateCompleted").Value)
17: (rs.Fields.Item("BudgetPurpose").Value)

Have I mentioned I really can't stand Dreamweaver? Ok, now that that i off my chest :)

Check the field types for these disappearing fields in the database. See if they are all differant from the ones that are displaying correctly o if there is a common thread between them. You may want to try putting cStr() functions around them to see what happens (if any are null you'll get big fat error messages).

-T

barcode_1.gif
 
I see no difference in the fields that are printing and the fields that aren't printing. If I place 6 of the above fields on the page, they display. If I add a 7th field, it doesn't display. If I remove the 6 fields and place the last two fields on the page, they display the data. any ideas? Is there some kind of buffer I can set?
 
Blindshot: do you have On Error Resume Next in Connections/rs.asp?
 
No I don't have On Error Resume Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top