Displacement downwards of dabase records displayed
I am loading in records from an ACCESS 2002 database using a filter to find those matching the search criteria. For each record found I write a row in a table on the screen. The problem is that for every row written to the table, all rows are displaced from the top. That is, instead of all displayed records (rows) starting at the top the following occurs:
If one record is displayed it starts one unit from the top (I measured a distance of 8mm).
If two records are displayed, they start 16 mm from the top, and so on. If I display 35 records they are completely off the screen and I must scroll down to see where they begin. The VALIGN=top instruction has no effect. Would be grateful if anyone has any ideas.
The relevant code:
<%@ LANGUAGE="VBScript" %>
<% Option Explicit
Response.Expires = 0%>
<P><! display.asp 12/13/03></P>
<HTML>
<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#BED6D6">
<!
<%
Dim intTotalLen
. etc.
.
'
' **** Open data base and recordset for Orders table. this is a OLEDB connection
'
Set objConn = Server.CreateObject("ADODB.Connection")
strConn="PROVIDER=MICROSOFT.JET.OLEDB.4.0; DATA SOURCE=D:\wwwroot\petrapubcom\database\dbGO2002.md b"
objConn.open strConn
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.CursorLocation = adUseClient
objRS.Open "tblPrivOrders", strConn, adOpenKeyset, adLockReadOnly, adCmdTable
'
' **** set up filter to fetch only pertinent records
'
strCriteria = "Location = '" & strLocation & "' AND Category = '"
strCriteria = strCriteria & strCategory & "' AND SubCategory = '" & strSubCategory & "'"
objRS.Filter = strCriteria
'
' First tell user that search is on
'
Response.Write "For Location: " &strLocation
Response.Write " Searching Category: " &strCategory
Response.Write " For: " &strSubCategory
Response.Write " <BR>"
'
' **** Create start of table for displaying ads
'
Response.Write ("<TABLE BORDER='1' VALIGN='top' width='100%'>")
'
' **** Move through entire Orders Table, selecting only those records that match
'
If Not objRS.EOF Then
objRS.MoveFirst
'
' **** Top-Level DO LOOP, which displays all relevant ads
'
Do WHILE Not objRS.EOF
Response.Write "<TR VALIGN='top'><TD VALIGN='top'>"
strPicPath="pictures/" & objRS("ThumbPic").value
IF objRS("ThumbPic").value = "none" THEN
Response.Write "<IMG SRC='pictures/nophoto.gif' "
Response.Write "HEIGHT=50 WIDTH=100 ALT='no picture'>"
Else
Response.Write "<IMG SRC='"
Response.Write strPicPath
Response.Write "' ALT='no picture'>"
End IF
Response.Write "</TD><TD VALIGN='top'>"
.
.etc.
Response.Write "</TD><BR></TR>"
objRS.MoveNext
'
' **** End of Top-Level DO LOOP
'
Loop
Else
Response.Write "<td align=CENTER> no matches, please try later</td> "
End If
Response.Write ("</TABLE>")
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</BODY>
</HTML>
|