Incompatibility in retrieving data

  • Dalton Gilson
  • Born
  • Born
  • Dalton Gilson
  • Posts: 2

Post 3+ Months Ago

Hi Gurus
Something quite strange is happening with one of my scripts -- I'm building a site with ASP pages managing a SQL Server 2000 database, from dealing with "Contracts" of all kinds (in Portuguese).
- The goal of this actual set of pages is to allow Users to calculate the evolution of the price of (for instance) a periodic payment of a Contract in accordance with the escalation of economic costs -- please be acknowledged that in Brasil the recalculation of prices in Contracts only can be made after a period of at least 12 months (that's to say: everyone recalculates its costs each 12 months...).
- In a first page ("calcatualizacao"), the User will pick, from the database table "indecontb" (that stands for "INDices ECONomicos TaBle, a page that shows the monthly evolution of 04 different types of economic indexes), the index (as his Contract settles) that must be considered for calculating the price he wants to recalculate -- its code is here:
Code: [ Select ]
<%@enablesessionstate=false%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Contratos on Line &:& Atualize o valor do seu Contrato conforme o &Índice econômico</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="../../../inc/estiloCoL.css" type=text/css rel=stylesheet></HEAD>
<BODY>.....
<FORM name="calcatualizacao" method="POST" action="../../../biblioteca/indseconomicos/calcatualizacao2.asp">
Qual o índice utilizado pelo seu Contrato — ou que Você queira atualizar?<br>
<input type="radio" name="indatualiz" value="igpm"> "IGP-<i>M</i>" - Índice Geral de Preços do <i>Mercado financeiro</i><BR>
<input type="radio" name="indatualiz" value="igpdi"> "IGP-<i>DI</i>" - Índice Geral de Preços - <i>Disponibilidade Interna</i><BR>
<input type="radio" name="indatualiz" value="ipca"> "IPCA" - Índice de Preços ao Consumidor - <i>Ampliado</i><BR>
<input type="radio" name="indatualiz" value="poup01"> Índice de Rendimentos da <i>Caderneta de Poupança</i> do dia 1º do mês</DIV>
.....(there comes the "reset" and the "submit" buttons</FORM></BODY></HTML>
  1. <%@enablesessionstate=false%>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3. <HTML><HEAD><TITLE>Contratos on Line &:& Atualize o valor do seu Contrato conforme o &Índice econômico</TITLE>
  4. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  5. <LINK href="../../../inc/estiloCoL.css" type=text/css rel=stylesheet></HEAD>
  6. <BODY>.....
  7. <FORM name="calcatualizacao" method="POST" action="../../../biblioteca/indseconomicos/calcatualizacao2.asp">
  8. Qual o índice utilizado pelo seu Contrato — ou que Você queira atualizar?<br>
  9. <input type="radio" name="indatualiz" value="igpm"> "IGP-<i>M</i>" - Índice Geral de Preços do <i>Mercado financeiro</i><BR>
  10. <input type="radio" name="indatualiz" value="igpdi"> "IGP-<i>DI</i>" - Índice Geral de Preços - <i>Disponibilidade Interna</i><BR>
  11. <input type="radio" name="indatualiz" value="ipca"> "IPCA" - Índice de Preços ao Consumidor - <i>Ampliado</i><BR>
  12. <input type="radio" name="indatualiz" value="poup01"> Índice de Rendimentos da <i>Caderneta de Poupança</i> do dia 1º do mês</DIV>
  13. .....(there comes the "reset" and the "submit" buttons</FORM></BODY></HTML>
;
- In the second page ("calcatualizacao2"), a "form" is opened for the User:
(1st) inform the actual value of the Contract he wants to recalculate -- this information will be collected directly through an "input"; and, after,
(2st) indicate the month-and-year he wants to bring that value to -- choosing the respective row directly from a list of the data of that "indecontb" table (each row informs the month/year and the amount of the choosen index, its last number and, more, the cumulative escalation of the "last 12 months");
- both part run inside the same form, but there is no "Submit" button in this page, because the link to the next page comes automatically when clicking one of these rows in the database table -- its code is also here:
Code: [ Select ]
<%@ LANGUAGE = "VBScript"
ENABLESESSIONSTATE = False %>
<%
Option Explicit
On Error Resume Next
Response.Expires = 0
%>
<!-- #include virtual="../../../inc/inc-conexao.asp" -->
<!-- #include virtual="../../../inc/clsDatefunctions.asp" -->
<%
Dim objConn, objRS, strQ, x, varcodigoind
Dim strConnection
dim date_functions
Call abre_objConn

Set date_functions = new classDateFunctions
Set objRS = Server.CreateObject("ADODB.Recordset")
x = request.form("indatualiz")
varcodigoind = request.querystring("tit")
Set objRS.ActiveConnection = objConn

strQ = "SELECT TOP 24 indecontb.codigoind, indecontb.mesind, indecontb.anoind, indecontb.numeroind, indecontb.varmesind, indecontb.vardozemesind FROM indecontb WHERE tipoind LIKE '%" & x & "%' ORDER BY anoind DESC, mesind DESC"

objRS.Open strQ
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Contratos on Line &:& Atualize o valor do seu &Contrato conforme o &Índice econômico</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="../../../inc/estiloCoL.css" type=text/css rel=stylesheet>
<!-- #include virtual = "../inc/scrollbarbranco.css" --></head>

<BODY background="../../../imagens/back1.gif" onload="document.calcatualizacao2.valatualiz.focus()">.....
<FORM name="calcatualizacao2" method="POST" action="../../../biblioteca/indseconomicos/calcatualizacao3.asp">
<DIV style="position:absolute; align:center; top:120px; width:526px; font-family:verdana,arial; color:#000066; size:8pt;"><B>&Valor do Contrato ou parcela que Você queira atualizar: R$ </B><INPUT name="valatualiz" size=11 maxLength=15></DIV><BR>

<ilayer width=526 height=178><DIV style="position:absolute; align:left; left:10px; top:150px; width:526px; font-family:verdana,arial; color:#000066; size:8pt;"><B>&Clique sobre o mês/ano para o qual Você quer trazer o valor contratual:</B>

<layer width=526 height=2000>
<div style="left:5px; top:140; width:526px; height:150px; overflow:scroll;">

<TABLE class="letras" style="BEHAVIOR: url(../../../inc/sort.htc); BACKGROUND-COLOR: #E6E8FA" borderColor=#FFFFFF cellSpacing=0 cellPadding=2 border=1>

<THEAD><TR align=left>
<TD align="center" background="../../../imagens/blankEFEBEF.gif" width="70" style="font-family:verdana,tahoma,arial; font-size:7.5pt; color:#880000;"><B>Mês/Ano</B></FONT></TD>
<%
if x = "igpm" then
  x = "IGP-M"
elseif x = "igpdi" then
   x = "IGP-DI"
elseif x = "ipca" then
   x = "IPCA"
elseif x = "poup01" then
   x = "Poupança : dia 1º"
end if
%>
<TD align="left" background="../../../imagens/blankEFEBEF.gif" width="165" style="font-family:verdana,tahoma,arial; font-size:7.5pt; color:#880000;"><B>&<% = x %> do mês</B></FONT></TD>
<TD align="left" background="../../../imagens/blankEFEBEF.gif" width="150" style="font-family:verdana,tahoma,arial; font-size:7.5pt; color:#880000;"><B>&% <i>X</i> último mês</B></FONT></TD>
<TD align="left" background="../../../imagens/blankD8D9B0.gif" width="150" style="font-family:verdana,tahoma,arial; font-size:7.5pt; color:#880000;"><B>&% <i>X</i> últimos 12 meses</B></FONT></TD></TR></THEAD>

<TBODY>
<%
While Not objRS.EOF
  Response.Write "<TR><TD align='center' valign='top' width='70'><FONT color=#000066 size=1><a href='../../../biblioteca/indseconomicos/calcatualizacao3.asp?tit=" & objRs("codigoind") & "'>" & objRS("mesind") & "/" & objRS("anoind") & "</a></FONT></TD>"

  Response.Write "<TD align='right' valign='top' width='165'><FONT color=#000066 size=1><a href='../../../biblioteca/indseconomicos/calcatualizacao3.asp?tit=" & objRs("codigoind") & "'>" & FormatNumber(objRS("numeroind"), 4, -1) & "</a>&&&&&&&</FONT></TD>"

  Response.Write "<TD align='right' valign='top' width='150'><FONT color=#000066 size=1><a href='../../../biblioteca/indseconomicos/calcatualizacao3.asp?tit=" & objRs("codigoind") & "'>" & FormatNumber(objRS("varmesind"), 4, -1) & "&%</a>&&&&&&</FONT></TD>"

  Response.Write "<TD align='right' valign='top' background='../../../imagens/blankFFF7E7.gif' width='150'><FONT color=#880000 size=1><a href='../../../biblioteca/indseconomicos/calcatualizacao3.asp?tit=" & objRs("codigoind") & "'>" & FormatNumber(objRS("vardozemesind"), 4, -1) & "&%</a>&&&&&&</FONT></TD>"
  objRS.MoveNext
Wend

objRS.close
Call fecha_objConn
Set objRS = Nothing
%>
</TR></TBODY></TABLE></DIV></layer></DIV></ilayer></FORM>..... (and, finally, just the "back" button)
  1. <%@ LANGUAGE = "VBScript"
  2. ENABLESESSIONSTATE = False %>
  3. <%
  4. Option Explicit
  5. On Error Resume Next
  6. Response.Expires = 0
  7. %>
  8. <!-- #include virtual="../../../inc/inc-conexao.asp" -->
  9. <!-- #include virtual="../../../inc/clsDatefunctions.asp" -->
  10. <%
  11. Dim objConn, objRS, strQ, x, varcodigoind
  12. Dim strConnection
  13. dim date_functions
  14. Call abre_objConn
  15. Set date_functions = new classDateFunctions
  16. Set objRS = Server.CreateObject("ADODB.Recordset")
  17. x = request.form("indatualiz")
  18. varcodigoind = request.querystring("tit")
  19. Set objRS.ActiveConnection = objConn
  20. strQ = "SELECT TOP 24 indecontb.codigoind, indecontb.mesind, indecontb.anoind, indecontb.numeroind, indecontb.varmesind, indecontb.vardozemesind FROM indecontb WHERE tipoind LIKE '%" & x & "%' ORDER BY anoind DESC, mesind DESC"
  21. objRS.Open strQ
  22. %>
  23. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  24. <HTML><HEAD><TITLE>Contratos on Line &:& Atualize o valor do seu &Contrato conforme o &Índice econômico</TITLE>
  25. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  26. <LINK href="../../../inc/estiloCoL.css" type=text/css rel=stylesheet>
  27. <!-- #include virtual = "../inc/scrollbarbranco.css" --></head>
  28. <BODY background="../../../imagens/back1.gif" onload="document.calcatualizacao2.valatualiz.focus()">.....
  29. <FORM name="calcatualizacao2" method="POST" action="../../../biblioteca/indseconomicos/calcatualizacao3.asp">
  30. <DIV style="position:absolute; align:center; top:120px; width:526px; font-family:verdana,arial; color:#000066; size:8pt;"><B>&Valor do Contrato ou parcela que Você queira atualizar: R$ </B><INPUT name="valatualiz" size=11 maxLength=15></DIV><BR>
  31. <ilayer width=526 height=178><DIV style="position:absolute; align:left; left:10px; top:150px; width:526px; font-family:verdana,arial; color:#000066; size:8pt;"><B>&Clique sobre o mês/ano para o qual Você quer trazer o valor contratual:</B>
  32. <layer width=526 height=2000>
  33. <div style="left:5px; top:140; width:526px; height:150px; overflow:scroll;">
  34. <TABLE class="letras" style="BEHAVIOR: url(../../../inc/sort.htc); BACKGROUND-COLOR: #E6E8FA" borderColor=#FFFFFF cellSpacing=0 cellPadding=2 border=1>
  35. <THEAD><TR align=left>
  36. <TD align="center" background="../../../imagens/blankEFEBEF.gif" width="70" style="font-family:verdana,tahoma,arial; font-size:7.5pt; color:#880000;"><B>Mês/Ano</B></FONT></TD>
  37. <%
  38. if x = "igpm" then
  39.   x = "IGP-M"
  40. elseif x = "igpdi" then
  41.    x = "IGP-DI"
  42. elseif x = "ipca" then
  43.    x = "IPCA"
  44. elseif x = "poup01" then
  45.    x = "Poupança : dia 1º"
  46. end if
  47. %>
  48. <TD align="left" background="../../../imagens/blankEFEBEF.gif" width="165" style="font-family:verdana,tahoma,arial; font-size:7.5pt; color:#880000;"><B>&<% = x %> do mês</B></FONT></TD>
  49. <TD align="left" background="../../../imagens/blankEFEBEF.gif" width="150" style="font-family:verdana,tahoma,arial; font-size:7.5pt; color:#880000;"><B>&% <i>X</i> último mês</B></FONT></TD>
  50. <TD align="left" background="../../../imagens/blankD8D9B0.gif" width="150" style="font-family:verdana,tahoma,arial; font-size:7.5pt; color:#880000;"><B>&% <i>X</i> últimos 12 meses</B></FONT></TD></TR></THEAD>
  51. <TBODY>
  52. <%
  53. While Not objRS.EOF
  54.   Response.Write "<TR><TD align='center' valign='top' width='70'><FONT color=#000066 size=1><a href='../../../biblioteca/indseconomicos/calcatualizacao3.asp?tit=" & objRs("codigoind") & "'>" & objRS("mesind") & "/" & objRS("anoind") & "</a></FONT></TD>"
  55.   Response.Write "<TD align='right' valign='top' width='165'><FONT color=#000066 size=1><a href='../../../biblioteca/indseconomicos/calcatualizacao3.asp?tit=" & objRs("codigoind") & "'>" & FormatNumber(objRS("numeroind"), 4, -1) & "</a>&&&&&&&</FONT></TD>"
  56.   Response.Write "<TD align='right' valign='top' width='150'><FONT color=#000066 size=1><a href='../../../biblioteca/indseconomicos/calcatualizacao3.asp?tit=" & objRs("codigoind") & "'>" & FormatNumber(objRS("varmesind"), 4, -1) & "&%</a>&&&&&&</FONT></TD>"
  57.   Response.Write "<TD align='right' valign='top' background='../../../imagens/blankFFF7E7.gif' width='150'><FONT color=#880000 size=1><a href='../../../biblioteca/indseconomicos/calcatualizacao3.asp?tit=" & objRs("codigoind") & "'>" & FormatNumber(objRS("vardozemesind"), 4, -1) & "&%</a>&&&&&&</FONT></TD>"
  58.   objRS.MoveNext
  59. Wend
  60. objRS.close
  61. Call fecha_objConn
  62. Set objRS = Nothing
  63. %>
  64. </TR></TBODY></TABLE></DIV></layer></DIV></ilayer></FORM>..... (and, finally, just the "back" button)

- ...but the problem appears when We reach the "page3" ("calcatualizacao3") intended to show this data (and where the program will make a simple calculation of the actual value X the desired escalation index, and show the new value):
- almost all data are shown - unless the "actual contractual value" (that one that is picked directly from an "input" at "calcatualizacao2" page)
- I cannot reach why! I even tried transfering that "input" command to page3, but it become worse: those other data ...disapeared!!! Please take a look at the code:
Code: [ Select ]
<%@ LANGUAGE = "VBScript"
ENABLESESSIONSTATE = False %>
<%
Option Explicit
On Error Resume Next
Response.Expires = 0
%>
<!-- #include virtual="../../../inc/inc-conexao.asp" -->
<!-- #include virtual="../../../inc/clsDatefunctions.asp" -->
<%
Dim objConn, objRS, strQ, y, i, m, a, n, k, varcodigoind
Dim strConnection
dim date_functions
Call abre_objConn

Set date_functions = new classDateFunctions
Set objRS = Server.CreateObject("ADODB.Recordset")
y = Request.form("valatualiz")
varcodigoind = request.querystring("tit")
Set objRS.ActiveConnection = objConn

strQ = "SELECT TOP 24 indecontb.codigoind, indecontb.mesind, indecontb.anoind, indecontb.numeroind, indecontb.varmesind, indecontb.vardozemesind, indecontb.tipoind FROM indecontb WHERE codigoind LIKE '%" & varcodigoind & "%'"
objRS.Open strQ
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Contratos on Line &:& Atualize o valor do seu &Contrato conforme o &Índice econômico</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="../../../inc/estiloCoL.css" type=text/css rel=stylesheet>
<!-- #include virtual = "../inc/scrollbarbranco.css" --></head>

<BODY background="../../../imagens/back1.gif" onload="document.calcatualizacao2.valatualiz.focus()">.....
<FORM><DIV style="position:absolute; width:526px; top:57px;">
<%
i = objRS("tipoind")
m = objRS("mesind")
a = objRS("anoind")
n = objRS("numeroind")
k = FormatNumber(objRS("vardozemesind"), 4, -1)
%>
Nome do índice: <% = i %><BR>
Mês/ano a que se refere: <% = m %>/<% = a %><BR>
Índice respectivo: <% = n %><BR>
Variação nos últimos 12 meses: <% = k %><BR><BR>

Valor contratual atual-k: R$ <% = y %><BR>
Valor contratual atual-valatualiz: R$ <% = valatualiz %><BR>
</FORM>
  1. <%@ LANGUAGE = "VBScript"
  2. ENABLESESSIONSTATE = False %>
  3. <%
  4. Option Explicit
  5. On Error Resume Next
  6. Response.Expires = 0
  7. %>
  8. <!-- #include virtual="../../../inc/inc-conexao.asp" -->
  9. <!-- #include virtual="../../../inc/clsDatefunctions.asp" -->
  10. <%
  11. Dim objConn, objRS, strQ, y, i, m, a, n, k, varcodigoind
  12. Dim strConnection
  13. dim date_functions
  14. Call abre_objConn
  15. Set date_functions = new classDateFunctions
  16. Set objRS = Server.CreateObject("ADODB.Recordset")
  17. y = Request.form("valatualiz")
  18. varcodigoind = request.querystring("tit")
  19. Set objRS.ActiveConnection = objConn
  20. strQ = "SELECT TOP 24 indecontb.codigoind, indecontb.mesind, indecontb.anoind, indecontb.numeroind, indecontb.varmesind, indecontb.vardozemesind, indecontb.tipoind FROM indecontb WHERE codigoind LIKE '%" & varcodigoind & "%'"
  21. objRS.Open strQ
  22. %>
  23. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  24. <HTML><HEAD><TITLE>Contratos on Line &:& Atualize o valor do seu &Contrato conforme o &Índice econômico</TITLE>
  25. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  26. <LINK href="../../../inc/estiloCoL.css" type=text/css rel=stylesheet>
  27. <!-- #include virtual = "../inc/scrollbarbranco.css" --></head>
  28. <BODY background="../../../imagens/back1.gif" onload="document.calcatualizacao2.valatualiz.focus()">.....
  29. <FORM><DIV style="position:absolute; width:526px; top:57px;">
  30. <%
  31. i = objRS("tipoind")
  32. m = objRS("mesind")
  33. a = objRS("anoind")
  34. n = objRS("numeroind")
  35. k = FormatNumber(objRS("vardozemesind"), 4, -1)
  36. %>
  37. Nome do índice: <% = i %><BR>
  38. Mês/ano a que se refere: <% = m %>/<% = a %><BR>
  39. Índice respectivo: <% = n %><BR>
  40. Variação nos últimos 12 meses: <% = k %><BR><BR>
  41. Valor contratual atual-k: R$ <% = y %><BR>
  42. Valor contratual atual-valatualiz: R$ <% = valatualiz %><BR>
  43. </FORM>

May You-Gurus be kind in helping me to find this mysterious patch? Thanks, many thanks since now!
Sincerely Dalton
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Dalton Gilson
  • Born
  • Born
  • Dalton Gilson
  • Posts: 2

Post 3+ Months Ago

By the way: in order to make easier to read them, here You have those 03 scripts, in .txt:
- http://www.contratosonline.com.br/bibli ... zacao1.txt
- http://www.contratosonline.com.br/bibli ... zacao2.txt
- http://www.contratosonline.com.br/bibli ... zacao3.txt
Thanks
Dalton

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 35 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.