View Single Post
Old 10-24-2012, 12:26 PM   PM User | #1
HalRau
New Coder

 
Join Date: Oct 2007
Posts: 33
Thanks: 3
Thanked 0 Times in 0 Posts
HalRau is an unknown quantity at this point
Select all rows of data and compare values

Hello, I'm trying to modify some code to select all rows of records in a access database table. I am seeing only the first record.
Here is the code:
Code:
<% 
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Hosting\wayn4797\access_db\Commentsdb.mdb;"
objConn.Open
Set objRs4=Server.CreateObject("ADODB.RecordSet")
sql4="SELECT * FROM DWUOComLog WHERE Com_live = True ORDER BY Com_Date ASC"

objRs4.Open sql4, objConn, 1, 1, 1
 %>

<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = objRs4_numRows + Repeat1__numRows
%>

<% response.Write objRs4("Article_ID") %>
Here is what I am using to compare a stored value Article_ID with a set value.

Code:
<%if (objRs4.Fields.Item("Article_ID").Value)="10-1" then%> Yes 
 <% ElseIf trim((objRs4.Fields.Item("Article_ID").Value))<>"10-1" Then %> No
      <% End If %> Article ID = <%=(objRs4.Fields.Item("Article_ID").Value)%>
The above code is repeated using different variables through out the page.
I am only seeing the value of the first record. Never any more. What am I doing wrong?
Thanks in advance for your help.
HalRau is offline   Reply With Quote