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

Computer Freezes When Calling Access Db

Status
Not open for further replies.

jessedh

MIS
Apr 16, 2002
96
US
Hello,

I had the following code working fine until it just decided to stop working. I get a system low on virtual memory message. I increased this and then I get a timed out error message. This was working perfectly before and now works like crap.

The only solace that I have is that if I remove the table html, it does return the number of records, so I feel it has to do with the loop.

Any help is much appreciated!

Thanks
Jesse

<%@ Language=VBScript %>

<%

'This sample provides the basic steps to connect to
'an MSAccess database and view the records.



Dim conn
Dim rs
Dim strConn
Dim strSQL
Dim appNumb
Dim SQLstr
Dim lnNumb
Dim BorrLName

appNumb = Request.Form(&quot;txtAppNumb&quot;)
lnNumb = Request.Form(&quot;txtLoanNumber&quot;)
BorrLName = Request.Form(&quot;txtBorrLName&quot;)

' used to isolate null strings

Select Case appNumb
Case &quot;&quot;
AppNumb = &quot;*&quot;
Case Else
AppNumb = AppNumb
End Select

Select Case lnNumb
Case &quot;&quot;
lnNumb = &quot;*&quot;
Case Else
lnNumb = lnNumb
End Select

Select Case BorrLName
Case &quot;&quot;
AppNumb = &quot;*&quot;
Case Else
BorrLName = BorrLName
End Select


strSQL = &quot;SELECT tbl1Master.[1ApplNumb], tbl1Master.LoanNumber, tbl1Master.Borr1LastName, tbl1Master.ProcessorCode, tblDisposition.StateCode, tblDisposition.TypeCode, tblDisposition.CostCenterCode, tbl2Status.CurrentStatus, tbl2Status.CurrentDate, tbl1Master.InvestorCode, tbl1Master.NoteAmount, tbl1Master.NoteRate, tbl1Master.OriginatorCode, tbl1Master.LoanWrittenBy, tbl1Master.PropertyState, tbl1Master.DocType, tbl3HudLines.[801], tbl3HudLines.[802], tbl3HudLines.[808], tblDisposition.[Wholesale/Retail], tblDisposition.[Conforming/Non-Conforming] &quot;& _
&quot;FROM ((tbl1Master INNER JOIN tbl2Status ON tbl1Master.[1ApplNumb] = tbl2Status.[2ApplNumb]) INNER JOIN tbl3HudLines ON tbl2Status.[2ApplNumb] = tbl3HudLines.[3ApplNumb]) INNER JOIN tblDisposition ON tbl3HudLines.[3ApplNumb] = tblDisposition.[1ApplNumb] &quot;& _
&quot;WHERE tbl1Master.[1ApplNumb] like '%&quot; & appNumb & &quot;%' and tbl1Master.[LoanNumber] like '%&quot; & lnNumb & &quot;%' and tbl1Master.[Borr1LastName] like '%&quot; & BorrLName & &quot;%'&quot;

'Create the object. In this case Connection to a database
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)

'Select the provider
Conn.Provider = &quot;Microsoft.Jet.OLEDB.4.0&quot;

'Select the data source.
Conn.ConnectionString = &quot;Data Source=C:\Inetpub\
'Open the connection
Conn.Open

'Create a recordset object
Set Rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)

'Open the recordset with the connection created earlier
Rs.Open strSQL,Conn, 1,3
%>

You Have Returned <%Response.write rs.RecordCount%> Records

<br><br>

<%
'Loop thru the records
do while not rs.EOF
%>

<hr>
<table border=&quot;1&quot; width=&quot;643&quot; height=&quot;274&quot;>
<tr>
<td width=&quot;120&quot; height=&quot;34&quot; align=&quot;right&quot;>App Number:</td>
<td width=&quot;166&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;1ApplNumb&quot;) %></td>
<td width=&quot;169&quot; height=&quot;34&quot; align=&quot;right&quot;><b>Type Code:</b></td>
<td width=&quot;160&quot; height=&quot;34&quot; align=&quot;left&quot;> <% Response.Write rs(&quot;TypeCode&quot;) %></td>
</tr>
<tr>
<td width=&quot;120&quot; height=&quot;34&quot; align=&quot;right&quot;>Loan Number:</td>
<td width=&quot;166&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;LoanNumber&quot;) %></td>
<td width=&quot;169&quot; height=&quot;34&quot; align=&quot;right&quot;><b>Cost Center Code:</b></td>
<td width=&quot;160&quot; height=&quot;34&quot; align=&quot;left&quot;> <% Response.Write rs(&quot;CostCenterCode&quot;) %></td>
</tr>
<tr>
<td width=&quot;120&quot; height=&quot;34&quot; align=&quot;right&quot;>Borr Last Name:</td>
<td width=&quot;166&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;Borr1LastName&quot;) %></td>
<td width=&quot;169&quot; height=&quot;34&quot; align=&quot;right&quot;><b>Product Code:</b></td>
<td width=&quot;160&quot; height=&quot;34&quot; align=&quot;left&quot;> <% Response.Write rs(&quot;StateCode&quot;) %></td>
</tr>
<tr>
<td width=&quot;120&quot; height=&quot;34&quot; align=&quot;right&quot;>Investor Code:</td>
<td width=&quot;166&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;InvestorCode&quot;) %></td>
<td width=&quot;169&quot; height=&quot;34&quot; align=&quot;right&quot;>Processor Code:</td>
<td width=&quot;160&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;ProcessorCode&quot;) %></td>
</tr>
<tr>
<td width=&quot;120&quot; height=&quot;34&quot; align=&quot;right&quot;>Property State:</td>
<td width=&quot;166&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;PropertyState&quot;) %></td>
<td width=&quot;169&quot; height=&quot;34&quot; align=&quot;right&quot;>Originator Code:</td>
<td width=&quot;160&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;OriginatorCode&quot;) %></td>
</tr>
<tr>
<td width=&quot;120&quot; height=&quot;34&quot; align=&quot;right&quot;>Wholesale / Retail:</td>
<td width=&quot;166&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;Wholesale/Retail&quot;) %></td>
<td width=&quot;169&quot; height=&quot;34&quot; align=&quot;right&quot;>Current Status:</td>
<td width=&quot;160&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;CurrentStatus&quot;) %></td>
</tr>
<tr>
<td width=&quot;120&quot; height=&quot;34&quot; align=&quot;right&quot;>Conforming?:</td>
<td width=&quot;166&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;Conforming/Non-Conforming&quot;) %></td>
<td width=&quot;169&quot; height=&quot;34&quot; align=&quot;right&quot;>Current Date:</td>
<td width=&quot;160&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;CurrentDate&quot;) %></td>
</tr>
</table>
<hr>



<%
loop

'Remove the Connection and Recordset
set Rs = nothing
set Conn = nothing
%>
</script>
 
...............
<td width=&quot;120&quot; height=&quot;34&quot; align=&quot;right&quot;>Conforming?:</td>
<td width=&quot;166&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;Conforming/Non-Conforming&quot;) %></td>
<td width=&quot;169&quot; height=&quot;34&quot; align=&quot;right&quot;>Current Date:</td>
<td width=&quot;160&quot; height=&quot;34&quot;> <% Response.Write rs(&quot;CurrentDate&quot;) %></td>
</tr>
</table>
<hr>



<%
[red]RS.MOVENEXT[/red]
Loop

you have to advance your recordset in the loop otherwise you have an indefinate loop cycle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top