Forums
This topic is locked
Help Visual Basic, ASP, Database
Posted 03 Apr 2006 18:32:21
1
has voted
03 Apr 2006 18:32:21 Ricky Cortes posted:
Hi im trying to write this results to my database eather directly to the database itself or at least send the results as a string to a page that can request the strings and write them to the database can someone help me Im lost here thanks.You can write me to
Replies
Replied 03 Apr 2006 18:33:40
03 Apr 2006 18:33:40 Ricky Cortes replied:
this is the code
Dim P 'Payment
Dim I 'Interest
Dim L 'Loan Term In Years
Dim J
Dim N
Dim M
Dim H
Dim C
Dim Q
Dim X
Dim k
'Set the Conter for the Ammoritization
X=0
'Replace these with your variables
'Total of Loan Amount
P= 2000
'Interest Rate
I=25
'Loan term in months
L=10
'Calculate Monthly Interest
J=I/(12 * 100)
'Length of loan in Months
N=L
'Now the magic.....
M = P * ( J / (1 - (1 + J) ^ -N))
Response.Write "<B>Monthly Payment: " & Round(M, 2) & "</B><BR>"
Response.Write "<TABLE cellSpacing=1 cellPadding=1 width=""55%"" bgColor=silver border=0>"
Response.Write "<TD bgColor=#708090>Contrato ID</TD>"
Response.Write "<TD bgColor=#708090>Fecha de Pago</TD>"
Response.Write "<TD bgColor=#708090>Interes</TD>"
Response.Write "<TD bgColor=#708090>Principal </TD>"
Response.Write "<TD bgColor=#708090>Balance</TD>"
Response.Write "<TD bgColor=#708090>Pago</TD></TR>"
Response.Write "<TR>"
'Loop through And Get the Monthly Paymen
' ts for the length of the loan
Do While X < N
Response.Write "<TD bgColor=silver>" & (z.Fields.Item("contrato_id".Value) & "</TD>"
Response.Write "<TD bgColor=silver>" & dateadd("m",X,(z.Fields.Item("con_fecha".Value)) & "</TD>"
H=P*J
Response.Write "<TD bgColor=silver>" & Round(H, 2) & "</TD>"
C=M-H
Response.Write "<TD bgColor=silver>" & Round(C, 2) & "</TD>"
Q=P-C
Response.Write "<TD bgColor=silver>" & Round(Q, 2) & "</TD>"
P=Q
Response.Write "<TD bgColor=silver>" & Round(C+H,2) & "</TD></TR>"
X=X+1
Loop
Dim P 'Payment
Dim I 'Interest
Dim L 'Loan Term In Years
Dim J
Dim N
Dim M
Dim H
Dim C
Dim Q
Dim X
Dim k
'Set the Conter for the Ammoritization
X=0
'Replace these with your variables
'Total of Loan Amount
P= 2000
'Interest Rate
I=25
'Loan term in months
L=10
'Calculate Monthly Interest
J=I/(12 * 100)
'Length of loan in Months
N=L
'Now the magic.....
M = P * ( J / (1 - (1 + J) ^ -N))
Response.Write "<B>Monthly Payment: " & Round(M, 2) & "</B><BR>"
Response.Write "<TABLE cellSpacing=1 cellPadding=1 width=""55%"" bgColor=silver border=0>"
Response.Write "<TD bgColor=#708090>Contrato ID</TD>"
Response.Write "<TD bgColor=#708090>Fecha de Pago</TD>"
Response.Write "<TD bgColor=#708090>Interes</TD>"
Response.Write "<TD bgColor=#708090>Principal </TD>"
Response.Write "<TD bgColor=#708090>Balance</TD>"
Response.Write "<TD bgColor=#708090>Pago</TD></TR>"
Response.Write "<TR>"
'Loop through And Get the Monthly Paymen
' ts for the length of the loan
Do While X < N
Response.Write "<TD bgColor=silver>" & (z.Fields.Item("contrato_id".Value) & "</TD>"
Response.Write "<TD bgColor=silver>" & dateadd("m",X,(z.Fields.Item("con_fecha".Value)) & "</TD>"
H=P*J
Response.Write "<TD bgColor=silver>" & Round(H, 2) & "</TD>"
C=M-H
Response.Write "<TD bgColor=silver>" & Round(C, 2) & "</TD>"
Q=P-C
Response.Write "<TD bgColor=silver>" & Round(Q, 2) & "</TD>"
P=Q
Response.Write "<TD bgColor=silver>" & Round(C+H,2) & "</TD></TR>"
X=X+1
Loop
Replied 03 Apr 2006 20:24:20
03 Apr 2006 20:24:20 Dave Thomas replied:
been answered here.
www.dmxzone.com/forum/topic.asp?topic_id=34580
pls don't spam post in multiple forums.
regards
Dave Thomas
<b>DMX Zone Forums Manager</b>
Tip: Use Google or our own Search function to find answers before asking. You'd be surprised what's already written <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
www.dmxzone.com/forum/topic.asp?topic_id=34580
pls don't spam post in multiple forums.
regards
Dave Thomas
<b>DMX Zone Forums Manager</b>
Tip: Use Google or our own Search function to find answers before asking. You'd be surprised what's already written <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>