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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL problem in Select Statement?

Status
Not open for further replies.

ziggs

Technical User
Sep 21, 2000
195
US
I'm having problems with an Oracle DB and MS Access extraction. Both DB's are linked by an Event number in the same format. Here's the SQL connections.



SQL = "SELECT * from [TBL-CASES] ORDER BY [case#] DESC"
set rs = my_conn.Execute(SQL)

SQL14 = "SELECT * FROM SERVER1.MASTER"
SQL14 = SQL14 & " WHERE MASTER.IM_DR = '" & rs("case#") & "'"
set rs14 = my_conn1.Execute(SQL14)


Now, here's my problem. I have 20 records in access DB and 100,000 in Oracle. When populated the 20 records, my movenext statement properly goes through each record and displays all 20 records. However, when I try to also add data from the second recordset from Oracle DB, it only populates the first record over and over again. I can't seem to get the rs14 recordset to movenext properly. Here's the rest of code if it helps:

<%if rs.eof then%>
<TR>
<TD bgcolor=<%=InfoField%> align=center colspan=10><B>No history </B></TD>
</TR>

<%
else
do until rs.eof
%>
<TR>
<TD bgcolor=<%=InfoField%> align=left><%=rs(&quot;case#&quot;)%>&nbsp;</TD>
<TD bgcolor=<%=InfoField%> align=left><%=rs(&quot;damage&quot;)%>&nbsp;</TD>
<TD bgcolor=<%=InfoField%> align=left><%=rs25(&quot;painttransfer&quot;)%>&nbsp;</TD>
<TD bgcolor=<%=InfoField%> align=left><%=rs14(&quot;IM_DATE&quot;)%>&nbsp;</TD>
</TR>

<%
rs.movenext
rs14.movenext
loop
end if
%>
 
Is it even possible to link the Oracle database and MS Access Database by a commin field or is this my problem? I still can't figure this out.
 
ziggs,

Change the following:

<%if rs.eof then%>

to

<%if NOT rs.eof then%>

fengshui1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top