Jump to content
Fórum Script Brasil
  • 0

Asp Com Sql


Helena.fleur
 Share

Question

Olá para todos.

preciso de ajuda pra tirar uma dúvida.

tenho 2 paginas asp com vbscript na primeira aparece os campos e o contéudo de uma tabela sql, nessa tabela tem os campos codigo e total que soma o total de clientes para cada codigo. e na outra tabela tem o codigo que é o mesmo da tabela anterior e o nome dos clientes e os numeros dos contratos de cada cliente.

O que eu quero é que quando eu clicar em um numero que esteja no campo total da tabela 1 liste na outra pagina o nome dos clientes, o codigo e o numero do contrato.

Da maneira que eu fiz está aparecendo em parte o que eu quero, o problema é que quando eu dou um clique em qualquer numero do campo total sempre aparece na outra pagina todos os codigo, nome dos clientes e contratos.

se alguém puder me ajudar agradeço muito.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%

' technocurve arc 3 asp vb mv block1/3 start

Dim moColor1, moColor2, moColor

moColor1 = "#B3D9FF"

moColor2 = "#FFFFFF"

moColor3 = "#CCCCCC"

moColor = moColor1

' technocurve arc 3 asp vb mv block1/3 start

%>

<!--#include file="Connections/objConn.asp" -->

<%

Dim objRS

Dim objRS_numRows

Set objRS = Server.CreateObject("ADODB.Recordset")

objRS.ActiveConnection = MM_objConn_STRING

objRS.Source = "SELECT * FROM dbo.Con_DescontosEMGEA_GiterFO"

objRS.CursorType = 0

objRS.CursorLocation = 2

objRS.LockType = 1

objRS.Open()

objRS_numRows = 0

%>

<%

Dim Repeat1__numRows

Dim Repeat1__index

Repeat1__numRows = 45

Repeat1__index = 0

objRS_numRows = objRS_numRows + Repeat1__numRows

%>

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<table width="75%" border="0" align="center">

<tr>

<td width="16%" valign="top"><img src="teste.jpg" width="152" height="54"></td>

<td width="84%" bgcolor="#2F80D0"><div align="center"><font color="#FFFFFF" size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>CONTRATOS

PARTICIPANTES DO PROGRAMA</strong></font></div></td>

</tr>

</table>

<br>

<table width="652" border="0" align="center" cellpadding="2" cellspacing="2">

<tr bgcolor="#33CCFF">

<td width="131"><div align="center"><font face="Georgia, Times New Roman, Times, serif"><strong>EN_NOME</strong></font></div></td>

<td width="93"><div align="center"><font face="Georgia, Times New Roman, Times, serif"><strong>EN</strong></font></div></td>

<td width="107"><div align="center"><font face="Georgia, Times New Roman, Times, serif"><strong>AG&Ecirc;NCIA</strong></font></div></td>

<td width="172"><div align="center"><font face="Georgia, Times New Roman, Times, serif"><strong>UNO</strong></font></div></td>

<td width="117"><div align="center"><font face="Georgia, Times New Roman, Times, serif"><strong>TOTAL</strong></font></div></td>

</tr>

<%

While ((Repeat1__numRows <> 0) AND (NOT objRS.EOF))

%>

<tr <%

' technocurve arc 3 asp vb mv block2/3 start

Response.Write(" style='background-color:" & moColor & "' onMouseOver='this.style.backgroundColor=" & chr(34) & moColor3 & chr(34) & "' onMouseOut='this.style.backgroundColor=" & chr(34) & moColor & chr(34) & "'")

' technocurve arc 3 asp vb mv block2/3 start

%>>

<td><div align="left"><font size="2" face="Arial, Helvetica, sans-serif"><%=(objRS.Fields.Item("EN_NOME").Value)%></font></div></td>

<td><div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><%=(objRS.Fields.Item("EN").Value)%></font></div></td>

<td><div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><%=(objRS.Fields.Item("Nome").Value)%></font></div></td>

<td><div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><%=(objRS.Fields.Item("Uno").Value)%></font></div></td>

<td><div align="center"><a href="PAGE.asp"><font size="2" face="Arial, Helvetica, sans-serif"><%=(objRS.Fields.Item("Total").Value)%></font></a></div></td>

</tr>

<%

Repeat1__index=Repeat1__index+1

Repeat1__numRows=Repeat1__numRows-1

objRS.MoveNext()

Wend

%>

<%

' technocurve arc 3 asp vb mv block3/3 start

if moColor = moColor1 then

moColor = moColor2

else

moColor = moColor1

end if

' technocurve arc 3 asp vb mv block3/3 start

%>

</table>

</body>

</html>

<%

objRS.Close()

Set objRS = Nothing

%>

________________________________________________________________________________________

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%

' technocurve arc 3 asp vb mv block1/3 start

Dim moColor1, moColor2, moColor

moColor1 = "#99CCFF"

moColor2 = "#CCCCCC"

moColor3 = "#FF9900"

moColor = moColor1

' technocurve arc 3 asp vb mv block1/3 start

%>

<!--#include file="Connections/Cn.asp" -->

<%

Dim ObjRS

Dim ObjRS_numRows

Set ObjRS = Server.CreateObject("ADODB.Recordset")

ObjRS.ActiveConnection = MM_Cn_STRING

ObjRS.Source = "SELECT * from dbo.[Descontos EMGEA GITER_FO]"

ObjRS.CursorType = 1

ObjRS.CursorLocation = 2

ObjRS.LockType = 1

ObjRS.Open()

%>

<%

Dim Repeat1__numRows

Dim Repeat1__index

Repeat1__numRows = -1

Repeat1__index = 0

ObjRS_numRows = ObjRS_numRows + Repeat1__numRows

%>

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<p>&nbsp;</p>

<table width="75%" border="0" align="center">

<tr>

<td width="16%" valign="top"><img src="teste.jpg" width="152" height="54"></td>

<td width="84%" bgcolor="#2F80D0"><div align="center"><font color="#FFFFFF" size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>CONTRATOS

PARTICIPANTES DO PROGRAMA</strong></font></div></td>

</tr>

</table>

<p>&nbsp;</p>

<table width="682" border="0" align="center" cellpadding="2" cellspacing="2">

<tr bgcolor="#99CCFF">

<td width="149" height="24"><div align="center"><font size="3" face="Georgia, Times New Roman, Times, serif"><strong>CONTRATO</strong></font></div></td>

<td width="302"><div align="center"><font size="3" face="Georgia, Times New Roman, Times, serif"><strong>MUTU&Aacute;RIO</strong></font></div></td>

<td width="96"><div align="center"><font size="3" face="Georgia, Times New Roman, Times, serif"><strong>UNO</strong></font></div></td>

</tr>

<%

While ((Repeat1__numRows <> 0) AND (NOT ObjRS.EOF))

%>

<tr <%

' technocurve arc 3 asp vb mv block2/3 start

Response.Write(" style='background-color:" & moColor & "' onMouseOver='this.style.backgroundColor=" & chr(34) & moColor3 & chr(34) & "' onMouseOut='this.style.backgroundColor=" & chr(34) & moColor & chr(34) & "'")

' technocurve arc 3 asp vb mv block2/3 start

%>>

<td><%=(ObjRS.Fields.Item("NUMERO_CONTRATO").Value)%></td>

<td><%=(ObjRS.Fields.Item("NOME_MUTUARIO").Value)%></td>

<td><%=(ObjRS.Fields.Item("UNO_CODIGO").Value)%></td>

</tr>

<%

Repeat1__index=Repeat1__index+1

Repeat1__numRows=Repeat1__numRows-1

ObjRS.MoveNext()

Wend

%>

<%

' technocurve arc 3 asp vb mv block3/3 start

if moColor = moColor1 then

moColor = moColor2

else

moColor = moColor1

end if

' technocurve arc 3 asp vb mv block3/3 start

%>

</table>

<p>&nbsp;</p>

</body>

</html>

<%

ObjRS.Close()

Set ObjRS = Nothing

%>

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      151k
    • Total Posts
      649.1k
×
×
  • Create New...