fanfy
asked on
SQL undefined
i have with the folllowing script when i m trying to addd to databse.
this code interface the user so as to enter the required data then submit to database.
'<% Response.Buffer = True %>
'<% If session("allow") = False Then Response.Redirect "main.asp" %>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
floatX=1;
floatY=1;
layerwidth=2100;
layerheight=50;
align="left";
valign="top";
delayspeed=3;
// This script is copyright (c) Henrik Petersen, NetKontoret
// Feel free to use this script on your own pages as long as you do not change it.
// It is illegal to distribute the script as part of a tutorial / script archive.
// Updated version available at: http://www.echoecho.com/toolfloatinglayer.htm
// This comment and the 4 lines above may not be removed from the code.
NS6=false;
IE4=(document.all);
if (!IE4) {NS6=(document.getElementB yId);}
NS4=(document.layers);
function adjust() {
if ((NS4) || (NS6)) {
if (lastX==-1 || delayspeed==0)
{
lastX=window.pageXOffset + floatX;
lastY=window.pageYOffset + floatY;
}
else
{
dx=Math.abs(window.pageXOf fset+float X-lastX);
dy=Math.abs(window.pageYOf fset+float Y-lastY);
d=Math.sqrt(dx*dx+dy*dy);
c=Math.round(d/10);
if (window.pageXOffset+floatX >lastX) {lastX=lastX+delayspeed+c; }
if (window.pageXOffset+floatX <lastX) {lastX=lastX-delayspeed-c; }
if (window.pageYOffset+floatY >lastY) {lastY=lastY+delayspeed+c; }
if (window.pageYOffset+floatY <lastY) {lastY=lastY-delayspeed-c; }
}
if (NS4){
document.layers['floatlaye r'].pageX = lastX;
document.layers['floatlaye r'].pageY = lastY;
}
if (NS6){
document.getElementById('f loatlayer' ).style.le ft=lastX;
document.getElementById('f loatlayer' ).style.to p=lastY;
}
}
else if (IE4){
if (lastX==-1 || delayspeed==0)
{
lastX=document.body.scroll Left + floatX;
lastY=document.body.scroll Top + floatY;
}
else
{
dx=Math.abs(document.body. scrollLeft +floatX-la stX);
dy=Math.abs(document.body. scrollTop+ floatY-las tY);
d=Math.sqrt(dx*dx+dy*dy);
c=Math.round(d/10);
if (document.body.scrollLeft+ floatX>las tX) {lastX=lastX+delayspeed+c; }
if (document.body.scrollLeft+ floatX<las tX) {lastX=lastX-delayspeed-c; }
if (document.body.scrollTop+f loatY>last Y) {lastY=lastY+delayspeed+c; }
if (document.body.scrollTop+f loatY<last Y) {lastY=lastY-delayspeed-c; }
}
document.all['floatlayer'] .style.pos Left = lastX;
document.all['floatlayer'] .style.pos Top = lastY;
}
setTimeout('adjust()',50);
}
function define()
{
if ((NS4) || (NS6))
{
if (align=="left") {floatX=ifloatX};
if (align=="right") {floatX=window.innerWidth- ifloatX-la yerwidth-2 0};
if (align=="center") {floatX=Math.round((window .innerWidt h-20)/2)-M ath.round( layerwidth /2)};
if (valign=="top") {floatY=ifloatY};
if (valign=="bottom") {floatY=window.innerHeight -ifloatY-l ayerheight };
if (valign=="center") {floatY=Math.round((window .innerHeig ht-20)/2)- Math.round (layerheig ht/2)};
}
if (IE4)
{
if (align=="left") {floatX=ifloatX};
if (align=="right") {floatX=document.body.offs etWidth-if loatX-laye rwidth-20}
if (align=="center") {floatX=Math.round((docume nt.body.of fsetWidth- 20)/2)-Mat h.round(la yerwidth/2 )}
if (valign=="top") {floatY=ifloatY};
if (valign=="bottom") {floatY=document.body.offs etHeight-i floatY-lay erheight}
if (valign=="center") {floatY=Math.round((docume nt.body.of fsetHeight -20)/2)-Ma th.round(l ayerheight /2)}
}
}
//-->
</script>
</head>
<SCRIPT Language=javascript> <!--
function validity(MPayment){
if (pula <= 0)
alert("You entered wrong Principal and Deposit !Please try again")
}
function formatCurrency(num) {
num = num.toString().replace(/\P |\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000 000001);
thebes = num%100;
num = Math.floor(num/100).toStri ng();
if(thebes<10)
thebes = "0" + thebes;
for (var i = 0; i < Math.floor((num.length-(1+ i))/3); i++)
num = num.substring(0,num.length -(4*i+3))+ ','+
num.substring(num.length-( 4*i+3));
return (((sign)?'':'-') + num + '.' + thebes);
form.mortgage.value = validity(MPayment);
}
min=100;
max=999;
function GenerateLoanNumber() {
//LoanNumber represents loan number generated
var str='LO';
var numb;
var loan;
numb = (Math.round((max-min) * Math.random() + min));
loan =str + numb;
return loan
}
function FixedPayment(form) {
//
// P represents the loan amount
// i Interest on the loan
// n Number of years
// q Number of payments per year
var P = parseFloat(form.principal. value);
var i //= parseFloat(form.interest.v alue)/100;
var n = parseFloat(form.term.value );
var d = parseFloat(form.deposit.va lue);
var q = 12;
var NPeriods;
var Power;
var Compound;
var Divide;
var MPayment;
NPeriods = -(n * q);
if (P <= 20000){
i=5;
} else
if ((P > 20000) && (P <=150000)){
i=10.25
}else if ((P > 150000) && (P<=500000)){
i=15.75;
}else
{
i=25.5;
}
Power = 1 + (i/q);
Compound = Math.pow(Power, NPeriods);
Divide = q *(1 - Compound);
MPayment = (((P - d)* i)/Divide)/12;
if (MPayment <= 0){
alert("You entered wrong Principal and Deposit !Please try again")
form.interest.value =0.00;
}else
form.LoanNumber.value = GenerateLoanNumber();
form.MonthlyInstallment.va lue = formatCurrency(MPayment);
form.interest.value =i;
}
//--></SCRIPT>
<meta name="Microsoft Theme" content="frb_coff 011">
</head>
<BODY background = "CHEESE.jpg">
<!--mstheme--></font>
<form name="Armotize" method="Post"action="loanf ormation.a sp">
<center><table width=600 border=0 cellspacing=0 cellpadding=0>
<tr><td valign=top width=440>
<!--mstheme--><font face="Arial, Arial, Helvetica">
<center>
<!--mstheme--></font>
<TABLE WIDTH=400 HEIGHT=400
BORDER="5" CELLSPACING="5" CELLPADDING="0" bordercolorlight="PaleGold enrod" bordercolordark="Palegolde nrod">
<TR bgcolor=PaleGoldenrod text=Sienna >
<TD COLSPAN=2 HEIGHT=25 ALIGN=center>
<!--mstheme--><font face="Arial, Arial, Helvetica">
<FONT SIZE="+1" face=arial color="#000000">Personal Loan Calculator</FONT>
<!--mstheme--></font>
</TD></TR>
<TR>
<TD COLSPAN=2 HEIGHT=25 ALIGN=center><!--mstheme-- ><font face="Arial, Arial, Helvetica"><font color="#000000">Use this
tool to estimate your monthly payment for your Personal Loan. Simply enter the appropriate
information in the BLAcK colored fields. Click the "Compute"
button and your monthly payment will appear in the field below
</font>
<!--mstheme--></font>
</TD></TR>
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme--> <font face="Arial, Arial, Helvetica"><font color="black">Customer ID#:</font> <!--msthe me--></fon t></TD>
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme-- ><font face="Arial, Arial, Helvetica">    ;
<INPUT NAME="CustID" TYPE="number" ><!--mstheme--></font></TD ></TR>
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme--> <font face="Arial, Arial, Helvetica"><font color="black">First Name:</font> <!--msth eme--></fo nt></TD>
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme-- ><font face="Arial, Arial, Helvetica">    ;
<INPUT NAME=txtFName TYPE=text-- SIZE=10 ><!--mstheme--></font></TD ></TR>
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme--> <font face="Arial, Arial, Helvetica"><font color="black">Loan#:</font > <!- -mstheme-- ></font></ TD>
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme-- ><font face="Arial, Arial, Helvetica">    ;
<INPUT NAME=LoanNumber TYPE=text SIZE=10 VALUE=><!--mstheme--></fon t></TD></T R>
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme--> <font face="Arial, Arial, Helvetica"><font color="black">Principal Loan:</font> <!--msth eme--></fo nt></TD>
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme-- ><font face="Arial, Arial, Helvetica"><B>P</B>
<INPUT NAME=principal TYPE=currency SIZE=10 VALUE=0.00><!--mstheme-->< /font></TD ></TR>
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme--> <font face="Arial, Arial, Helvetica"><font color="black">Deposit:</fo nt> < !--mstheme --></font> </TD>
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme-- ><font face="Arial, Arial, Helvetica"><B>P</B>
<INPUT NAME=deposit TYPE=text SIZE=10 VALUE=0.00><!--mstheme-->< /font></TD ></TR>
<TR>
<TD HEIGHT=25 ALIGN=right><!--mstheme--> <font face="Arial, Arial, Helvetica"><font color="black">Length of Loan:</font><font color="black"> </font ><!--msthe me--></fon t></TD>
<TD bgcolor=PaleGoldenrod text=Sienna ALIGN=center>
<!--mstheme--><font face="Arial, Arial, Helvetica">
&n bsp;
<INPUT NAME=term TYPE=text SIZE=6 VALUE=0> <B>years</B><!--mstheme--> </font></T D></TR>
<tr>
<TD HEIGHT=25 ALIGN=right><!--mstheme--> <font face="Arial, Arial, Helvetica"><B><font color="black">*Monthly Installment:</font></B>&nb sp;<!--mst heme--></f ont></TD>
<TD bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme-- ><font face="Arial, Arial, Helvetica"><B>P</B>
<INPUT NAME=MonthlyInstallment TYPE=currency SIZE=10 VALUE=><!--mstheme--></fon t></TD>
<TR>
<TD HEIGHT=25 ALIGN=right><!--mstheme--> <font face="Arial, Arial, Helvetica"><font color="black">Interest Rate: </font><!--msth eme--></fo nt></TD>
<TD bgcolor=PaleGoldenrod text=Sienna ALIGN=center>
<!--mstheme--><font face="Arial, Arial, Helvetica">
<INPUT NAME=interest TYPE=text SIZE=6 VALUE=> <B>%</B><!--mstheme--></fo nt></TD></ TR>
<TR>
<TD COLSPAN="2" HEIGHT="30" ALIGN="CENTER"><!--mstheme --><font face="Arial, Arial, Helvetica">
<INPUT TYPE="button" VALUE="Compute" onClick="FixedPayment(this .form)">
<INPUT TYPE="reset" NAME="reset" VALUE="Clear Fields">
<input type="submit" name="btnSearch" value="Add">
<!--mstheme--></font>
</TD></TR> </TABLE></center>
<!--mstheme--><font face="Arial, Arial, Helvetica">
</FORM>
</center>
<!--mstheme--></font>
</td></tr></table></center >
<!--mstheme--><font face="Arial, Arial, Helvetica"><!--mstheme-->< /font>
<table width=600 border=0 cellspacing=4 cellpadding=0>
<tr><td>
<!--mstheme--><font face="Arial, Arial, Helvetica">
<font face=arial size="-2" color="#000000"> &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp;
*This amount does not include payments for taxes or loan insurance.</font>
</center>
<!--mstheme--></font>
</td></tr></table>
<!--mstheme--><font face="Arial, Arial, Helvetica"><!--mstheme-->< /font>
<CENTER>
</form>
<script>
if (NS4) {document.write('<LAYER NAME="floatlayer" LEFT="'+floatX+'" TOP="'+floatY+'">');}
if ((IE4) || (NS6)) {document.write('<div id="floatlayer" style="position:absolute; left:'+floatX+'; top:'+floatY+';">');}
</script>
<table bgcolor="#CCCCCC" width="775" border="1">
<tr><td bgcolor="#FFFFCC" align="center"><b><font size="+1">PERSONAL LOAN DETERMINING SYSTEM MENU</font></b></td></tr>
<tr><td>
<b><font size="-1">
     & nbsp & nbsp & nbsp;:: <a href="form.asp">Home Page</a>
   :: <a href="http://Test/200003674/project/form.asp">Login</a>
:: <a href="form.asp">New User</a>
:: <a href="http://Test/200003674/project/loanform.html">Loan Application</a>
:: <a href="form.asp">Search</a>
:: <a href="form.asp">Loan Status</a>
:: <a href="form.asp">Administra tor</a>&nb sp;
:: <a href="form.asp">Balance Statement</a>
</font>
</td></tr>
</table><script>
if (NS4)
{
document.write('</LAYER>') ;
}
if ((IE4) || (NS6))
{
document.write('</DIV>');
}
ifloatX=floatX;
ifloatY=floatY;
define();
window.onresize=define;
lastX=-1;
lastY=-1;
adjust();
</script>
</body>
</html>
The issue is that i have to check whether the customer id # exists in blacklisted database(table) which stores all customers who failed to pay back the loan , before he/she can apply for loan.The following extract gives a headache since when i try executes (add to database) the following error message is dsiplayed.
"Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'SQL'
/200003674/project/loanfor mation.asp , line 24"
as in the following code
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="adovbs.inc."-->
<html>
<BODY background = "images/CHEESE.jpg">
<%
Dim MyConn,RS,strCustID,txtFNa me,strFNam e,strLoanN umber,strP rincipal, strDeposit,strInterest,str mortgage,s trterm,str MonthlyIns tallment
'grab the form contents
strCustID=Request.Form("Cu stID")
strFName=Trim(Request.Form ("txtFName "))
strLoanNumber = Request.Form("LoanNumber")
strPrincipal = Request.Form("Principal")
strDeposit = Request.Form("Deposit")
strterm = Request.Form("Term")
strInterest = Request.Form("Interest")
strMonthlyInstallment = Request.Form("MonthlyInsta llment")
SQL = "SELECT CustID FROM Customers,Blacklisted "
Set RS = MyConn.Execute(SQL)
if (strCustID <> "Blacklisted.CustID") Then
Set MyConn=Server.CreateObject ("ADODB.Co nnection")
Set RS=Server.CreateObject("AD ODB.Record Set")
'since you are working with the RecordSet you need to create an instance of
'the RecordSet Object
'Set RS2=Server.CreateObject("A DODB.Recor dSet")
'Set RS3=Server.CreateObject("A DODB.Recor dSet")
'in this case, since we're adding to two separate tables we need to create
'two instances of the RecordSet Object
MyConn.Open "PLDSloans"
'getdata is your DSN (data source name) you created through ODBC
RS.Open "Select * From Loans", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
'open both RecordSets
'SQL = "SELECT * FROM Customerss,Blacklisted "
'While Not RS.EOF
'If Customers.CustID <> "Blacklisted.CustID" Then
RS.AddNew
RS("LoanNumber")= strLoanNumber
RS("CustID")=strCustID
RS("Principal")= strPrincipal
RS("Deposit")= strDeposit
RS("Duration")= strterm
RS("Interest")= strInterest
RS("MonthlyInstallment")= strMonthlyInstallment
RS.Update
'Update the first RecordSet
Response.Write "<hr>"
Response.Write "<center><h3><b>CONFIRMATI ON LETTER</b></h3></center>"
Response.Write"<br></br><b r></br>"
Response.Write "<b>To Our Dear Customer</b><br>"
Response.Write "<b>NAME: Mr/Mrs/Miss </b>"&strFName&"<br>"
Response.Write "<b>CUSTOMER ID #:</b>"&strCustID&"<br>"
Response.Write "<br>"
Response.Write "This serves to inform you that you application is succesful, therefore you are expected to comply with the following payments in relation to momey you borrowed "
Response.Write "You are liable to pay a Monthly Payment of about :P"&strMonthlyInstallment& ". You are also reminded that you should note down cause you are expectted ton use it every time you want to view your Loan status"
Response.Write" starting from the end of next month .The following are extracted from your Loan Application form<br>"
Response.Write "<br></br>"
Response.Write "<b>Monthly Payment : P</b>"&strMonthlyInstallme nt&"<br>"
Response.Write "<b>Principal : P </b>"&strPrincipal&"<br>"
Response.Write "<b>Deposit : P</b>"&strDeposit&"<br>"
Response.Write "<b>Duration : </b>"&strterm&" Year(s)<br>"
Response.Write "<b>Loan Number : </b>"&strLoanNumber&"<br>"
Response.Write "<br></br>"
Response.Write "If you have any queries with above outlined statements please forward your <font color=red><u>QUERIES</u></ font> so that they can be analysed "
Response.Write "<br></br>"
Response.Write "<br></br>"
Response.Write "<b>From Fanaferian Mogapi </b><br> "
Response.Write "<b>Your Financial Advisor</b><br>"
Response.Write "<b>Personal Loan Determinibg System<b>"
Response.Write "<hr>"
'Clean up
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
Else
Response.Write"yuo are not liable to be lopaned since u still owe"
End If
'Wend
%>
</body>
</html>
this code interface the user so as to enter the required data then submit to database.
'<% Response.Buffer = True %>
'<% If session("allow") = False Then Response.Redirect "main.asp" %>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
floatX=1;
floatY=1;
layerwidth=2100;
layerheight=50;
align="left";
valign="top";
delayspeed=3;
// This script is copyright (c) Henrik Petersen, NetKontoret
// Feel free to use this script on your own pages as long as you do not change it.
// It is illegal to distribute the script as part of a tutorial / script archive.
// Updated version available at: http://www.echoecho.com/toolfloatinglayer.htm
// This comment and the 4 lines above may not be removed from the code.
NS6=false;
IE4=(document.all);
if (!IE4) {NS6=(document.getElementB
NS4=(document.layers);
function adjust() {
if ((NS4) || (NS6)) {
if (lastX==-1 || delayspeed==0)
{
lastX=window.pageXOffset + floatX;
lastY=window.pageYOffset + floatY;
}
else
{
dx=Math.abs(window.pageXOf
dy=Math.abs(window.pageYOf
d=Math.sqrt(dx*dx+dy*dy);
c=Math.round(d/10);
if (window.pageXOffset+floatX
if (window.pageXOffset+floatX
if (window.pageYOffset+floatY
if (window.pageYOffset+floatY
}
if (NS4){
document.layers['floatlaye
document.layers['floatlaye
}
if (NS6){
document.getElementById('f
document.getElementById('f
}
}
else if (IE4){
if (lastX==-1 || delayspeed==0)
{
lastX=document.body.scroll
lastY=document.body.scroll
}
else
{
dx=Math.abs(document.body.
dy=Math.abs(document.body.
d=Math.sqrt(dx*dx+dy*dy);
c=Math.round(d/10);
if (document.body.scrollLeft+
if (document.body.scrollLeft+
if (document.body.scrollTop+f
if (document.body.scrollTop+f
}
document.all['floatlayer']
document.all['floatlayer']
}
setTimeout('adjust()',50);
}
function define()
{
if ((NS4) || (NS6))
{
if (align=="left") {floatX=ifloatX};
if (align=="right") {floatX=window.innerWidth-
if (align=="center") {floatX=Math.round((window
if (valign=="top") {floatY=ifloatY};
if (valign=="bottom") {floatY=window.innerHeight
if (valign=="center") {floatY=Math.round((window
}
if (IE4)
{
if (align=="left") {floatX=ifloatX};
if (align=="right") {floatX=document.body.offs
if (align=="center") {floatX=Math.round((docume
if (valign=="top") {floatY=ifloatY};
if (valign=="bottom") {floatY=document.body.offs
if (valign=="center") {floatY=Math.round((docume
}
}
//-->
</script>
</head>
<SCRIPT Language=javascript> <!--
function validity(MPayment){
if (pula <= 0)
alert("You entered wrong Principal and Deposit !Please try again")
}
function formatCurrency(num) {
num = num.toString().replace(/\P
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000
thebes = num%100;
num = Math.floor(num/100).toStri
if(thebes<10)
thebes = "0" + thebes;
for (var i = 0; i < Math.floor((num.length-(1+
num = num.substring(0,num.length
num.substring(num.length-(
return (((sign)?'':'-') + num + '.' + thebes);
form.mortgage.value = validity(MPayment);
}
min=100;
max=999;
function GenerateLoanNumber() {
//LoanNumber represents loan number generated
var str='LO';
var numb;
var loan;
numb = (Math.round((max-min) * Math.random() + min));
loan =str + numb;
return loan
}
function FixedPayment(form) {
//
// P represents the loan amount
// i Interest on the loan
// n Number of years
// q Number of payments per year
var P = parseFloat(form.principal.
var i //= parseFloat(form.interest.v
var n = parseFloat(form.term.value
var d = parseFloat(form.deposit.va
var q = 12;
var NPeriods;
var Power;
var Compound;
var Divide;
var MPayment;
NPeriods = -(n * q);
if (P <= 20000){
i=5;
} else
if ((P > 20000) && (P <=150000)){
i=10.25
}else if ((P > 150000) && (P<=500000)){
i=15.75;
}else
{
i=25.5;
}
Power = 1 + (i/q);
Compound = Math.pow(Power, NPeriods);
Divide = q *(1 - Compound);
MPayment = (((P - d)* i)/Divide)/12;
if (MPayment <= 0){
alert("You entered wrong Principal and Deposit !Please try again")
form.interest.value =0.00;
}else
form.LoanNumber.value = GenerateLoanNumber();
form.MonthlyInstallment.va
form.interest.value =i;
}
//--></SCRIPT>
<meta name="Microsoft Theme" content="frb_coff 011">
</head>
<BODY background = "CHEESE.jpg">
<!--mstheme--></font>
<form name="Armotize" method="Post"action="loanf
<center><table width=600 border=0 cellspacing=0 cellpadding=0>
<tr><td valign=top width=440>
<!--mstheme--><font face="Arial, Arial, Helvetica">
<center>
<!--mstheme--></font>
<TABLE WIDTH=400 HEIGHT=400
BORDER="5" CELLSPACING="5" CELLPADDING="0" bordercolorlight="PaleGold
<TR bgcolor=PaleGoldenrod text=Sienna >
<TD COLSPAN=2 HEIGHT=25 ALIGN=center>
<!--mstheme--><font face="Arial, Arial, Helvetica">
<FONT SIZE="+1" face=arial color="#000000">Personal Loan Calculator</FONT>
<!--mstheme--></font>
</TD></TR>
<TR>
<TD COLSPAN=2 HEIGHT=25 ALIGN=center><!--mstheme--
tool to estimate your monthly payment for your Personal Loan. Simply enter the appropriate
information in the BLAcK colored fields. Click the "Compute"
button and your monthly payment will appear in the field below
</font>
<!--mstheme--></font>
</TD></TR>
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme-->
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme--
<INPUT NAME="CustID" TYPE="number" ><!--mstheme--></font></TD
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme-->
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme--
<INPUT NAME=txtFName TYPE=text-- SIZE=10 ><!--mstheme--></font></TD
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme-->
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme--
<INPUT NAME=LoanNumber TYPE=text SIZE=10 VALUE=><!--mstheme--></fon
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme-->
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme--
<INPUT NAME=principal TYPE=currency SIZE=10 VALUE=0.00><!--mstheme--><
<TR>
<TD WIDTH="48%" HEIGHT=25 ALIGN=right><!--mstheme-->
<TD WIDTH="52%" bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme--
<INPUT NAME=deposit TYPE=text SIZE=10 VALUE=0.00><!--mstheme--><
<TR>
<TD HEIGHT=25 ALIGN=right><!--mstheme-->
<TD bgcolor=PaleGoldenrod text=Sienna ALIGN=center>
<!--mstheme--><font face="Arial, Arial, Helvetica">
&n
<INPUT NAME=term TYPE=text SIZE=6 VALUE=0> <B>years</B><!--mstheme-->
<tr>
<TD HEIGHT=25 ALIGN=right><!--mstheme-->
<TD bgcolor=PaleGoldenrod text=Sienna ALIGN=center><!--mstheme--
<INPUT NAME=MonthlyInstallment TYPE=currency SIZE=10 VALUE=><!--mstheme--></fon
<TR>
<TD HEIGHT=25 ALIGN=right><!--mstheme-->
<TD bgcolor=PaleGoldenrod text=Sienna ALIGN=center>
<!--mstheme--><font face="Arial, Arial, Helvetica">
<INPUT NAME=interest TYPE=text SIZE=6 VALUE=> <B>%</B><!--mstheme--></fo
<TR>
<TD COLSPAN="2" HEIGHT="30" ALIGN="CENTER"><!--mstheme
<INPUT TYPE="button" VALUE="Compute" onClick="FixedPayment(this
<INPUT TYPE="reset" NAME="reset" VALUE="Clear Fields">
<input type="submit" name="btnSearch" value="Add">
<!--mstheme--></font>
</TD></TR> </TABLE></center>
<!--mstheme--><font face="Arial, Arial, Helvetica">
</FORM>
</center>
<!--mstheme--></font>
</td></tr></table></center
<!--mstheme--><font face="Arial, Arial, Helvetica"><!--mstheme--><
<table width=600 border=0 cellspacing=4 cellpadding=0>
<tr><td>
<!--mstheme--><font face="Arial, Arial, Helvetica">
<font face=arial size="-2" color="#000000"> &nbs
*This amount does not include payments for taxes or loan insurance.</font>
</center>
<!--mstheme--></font>
</td></tr></table>
<!--mstheme--><font face="Arial, Arial, Helvetica"><!--mstheme--><
<CENTER>
</form>
<script>
if (NS4) {document.write('<LAYER NAME="floatlayer" LEFT="'+floatX+'" TOP="'+floatY+'">');}
if ((IE4) || (NS6)) {document.write('<div id="floatlayer" style="position:absolute; left:'+floatX+'; top:'+floatY+';">');}
</script>
<table bgcolor="#CCCCCC" width="775" border="1">
<tr><td bgcolor="#FFFFCC" align="center"><b><font size="+1">PERSONAL LOAN DETERMINING SYSTEM MENU</font></b></td></tr>
<tr><td>
<b><font size="-1">
     &
   :: <a href="http://Test/200003674/project/form.asp">Login</a>
:: <a href="form.asp">New User</a>
:: <a href="http://Test/200003674/project/loanform.html">Loan Application</a>
:: <a href="form.asp">Search</a>
:: <a href="form.asp">Loan Status</a>
:: <a href="form.asp">Administra
:: <a href="form.asp">Balance Statement</a>
</font>
</td></tr>
</table><script>
if (NS4)
{
document.write('</LAYER>')
}
if ((IE4) || (NS6))
{
document.write('</DIV>');
}
ifloatX=floatX;
ifloatY=floatY;
define();
window.onresize=define;
lastX=-1;
lastY=-1;
adjust();
</script>
</body>
</html>
The issue is that i have to check whether the customer id # exists in blacklisted database(table) which stores all customers who failed to pay back the loan , before he/she can apply for loan.The following extract gives a headache since when i try executes (add to database) the following error message is dsiplayed.
"Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'SQL'
/200003674/project/loanfor
as in the following code
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="adovbs.inc."-->
<html>
<BODY background = "images/CHEESE.jpg">
<%
Dim MyConn,RS,strCustID,txtFNa
'grab the form contents
strCustID=Request.Form("Cu
strFName=Trim(Request.Form
strLoanNumber = Request.Form("LoanNumber")
strPrincipal = Request.Form("Principal")
strDeposit = Request.Form("Deposit")
strterm = Request.Form("Term")
strInterest = Request.Form("Interest")
strMonthlyInstallment = Request.Form("MonthlyInsta
SQL = "SELECT CustID FROM Customers,Blacklisted "
Set RS = MyConn.Execute(SQL)
if (strCustID <> "Blacklisted.CustID") Then
Set MyConn=Server.CreateObject
Set RS=Server.CreateObject("AD
'since you are working with the RecordSet you need to create an instance of
'the RecordSet Object
'Set RS2=Server.CreateObject("A
'Set RS3=Server.CreateObject("A
'in this case, since we're adding to two separate tables we need to create
'two instances of the RecordSet Object
MyConn.Open "PLDSloans"
'getdata is your DSN (data source name) you created through ODBC
RS.Open "Select * From Loans", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
'open both RecordSets
'SQL = "SELECT * FROM Customerss,Blacklisted "
'While Not RS.EOF
'If Customers.CustID <> "Blacklisted.CustID" Then
RS.AddNew
RS("LoanNumber")= strLoanNumber
RS("CustID")=strCustID
RS("Principal")= strPrincipal
RS("Deposit")= strDeposit
RS("Duration")= strterm
RS("Interest")= strInterest
RS("MonthlyInstallment")= strMonthlyInstallment
RS.Update
'Update the first RecordSet
Response.Write "<hr>"
Response.Write "<center><h3><b>CONFIRMATI
Response.Write"<br></br><b
Response.Write "<b>To Our Dear Customer</b><br>"
Response.Write "<b>NAME: Mr/Mrs/Miss </b>"&strFName&"<br>"
Response.Write "<b>CUSTOMER ID #:</b>"&strCustID&"<br>"
Response.Write "<br>"
Response.Write "This serves to inform you that you application is succesful, therefore you are expected to comply with the following payments in relation to momey you borrowed "
Response.Write "You are liable to pay a Monthly Payment of about :P"&strMonthlyInstallment&
Response.Write" starting from the end of next month .The following are extracted from your Loan Application form<br>"
Response.Write "<br></br>"
Response.Write "<b>Monthly Payment : P</b>"&strMonthlyInstallme
Response.Write "<b>Principal : P </b>"&strPrincipal&"<br>"
Response.Write "<b>Deposit : P</b>"&strDeposit&"<br>"
Response.Write "<b>Duration : </b>"&strterm&" Year(s)<br>"
Response.Write "<b>Loan Number : </b>"&strLoanNumber&"<br>"
Response.Write "<br></br>"
Response.Write "If you have any queries with above outlined statements please forward your <font color=red><u>QUERIES</u></
Response.Write "<br></br>"
Response.Write "<br></br>"
Response.Write "<b>From Fanaferian Mogapi </b><br> "
Response.Write "<b>Your Financial Advisor</b><br>"
Response.Write "<b>Personal Loan Determinibg System<b>"
Response.Write "<hr>"
'Clean up
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
Else
Response.Write"yuo are not liable to be lopaned since u still owe"
End If
'Wend
%>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Cause identified.
This question appears to have been abandoned. Please come back to this question and do the necessary evaluation or feedback. I will invite a Moderator to close this question if there's no reply from you after seven days.
I suggest
<points to kcm76>
** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **
hongjun
I suggest
<points to kcm76>
** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **
hongjun
Force accepted as proposed
modulo
Community Support Moderator
Experts Exchange
modulo
Community Support Moderator
Experts Exchange
fanfy, for variable not defined error, and the above is the solution u r looking for, then to be honest this question is not worth of more than 25 points.
KCM