<%@ Language=VBScript %> <% Option Explicit %> <% Dim oADOConn Dim oRS Dim sConnStr Dim sSQL Dim iCount Dim iCol Dim iColCount Dim iFieldCount Dim iResult Dim sTemp Dim sClientID sClientID = Session( "clientID" ) iFieldCount = 9 Session( "field1" ) = "type" Session( "field2" ) = "lender" Session( "field3" ) = "purpose" Session( "field4" ) = "originalloan" Session( "field5" ) = "currentbalance" Session( "field6" ) = "interestrate" Session( "field7" ) = "term" Session( "field8" ) = "startdate" Session( "field9" ) = "minrepayments" Session( "label1" ) = "Type" Session( "label2" ) = "Lender" Session( "label3" ) = "Purpose" Session( "label4" ) = "Original loan" Session( "label5" ) = "Current balance owing" Session( "label6" ) = "Interest rate" Session( "label7" ) = "Term (yrs)" Session( "label8" ) = "Start date" Session( "label9" ) = "Min repayments (pm)" sConnStr = "DBQ=" & Server.Mappath( "/database/propcafe.mdb" ) & ";Driver={Microsoft Access Driver (*.mdb)};" Set oADOConn = Nothing Set oADOConn = Server.CreateObject( "ADODB.Connection" ) oADOConn.ConnectionString = sConnStr oADOConn.Open %>
<% iColCount = 0 sSQL = "SELECT Count(*) AS Count FROM eOtherLoans WHERE clientID=" & sClientID Set oRS = Nothing Set oRS = oADOConn.Execute( sSQL, iResult ) iColCount = oRS( "Count" ).value For iCount = 0 to iFieldCount Response.Write "" if iCount > 0 then sSQL = "SELECT " & Session( "field" & CStr( iCount ) ) & " FROM eOtherLoans WHERE clientID=" & sClientID & " ORDER BY ID" Set oRS = Nothing Set oRS = oADOConn.Execute( sSQL, iResult ) end if For iCol = 0 to iColCount if iCol = 0 then if iCount = 0 then Response.Write "" else Response.Write "" sTemp = Session( "field" & CStr( iCount ) ) select case sTemp case "type" Response.Write "" case "purpose" Response.Write "" case else Response.Write "" end select end if else if iCount = 0 then Response.Write "" else sTemp = Session( "field" & CStr( iCount ) ) Response.Write "" end if if Not oRS.EOF then oRS.MoveNext end if end if Next oRS.Close Set oRS = Nothing Response.Write "" Next oADOConn.Close Set oADOConn = Nothing %>
 new " & Session( "Label" & CStr( iCount ) ) & " : " & CStr( iCol ) & " " & oRS( sTemp ).value & " 

Click here to Add other Loan Information. Click here to Continue to next Section. Click here to Cancel the Enquiry.