Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

cesarhtc

Resultado

Recommended Posts

Tenho o uma pesquisa que é esta trazendo o resultado abaixo.

Só que na 3 linha o fornecedor não é "2" e sim "1", já olhei na tabela esta gravado corretamente "1", quando faço pesquisa acontece isto.

Poderiam me ajudar?

Colacarei o codigo abaixo.

 

Agradeço pela força.

 

Cesarhtc

 

 

 CNPJ   Fornecedor  Nome   Email       Telefone     Retirado em: 78715   2        DFS  SDKJFKJ    646            19/10/2004 16:29:09             2        DFS  SDKJFKJ    646            19/10/2004 16:29:09 789527  2       DFS   SDKJFKJ    646            19/10/2004 16:29:09

 

******//**********

 

<!--#include file="cabeçalho.htm"-->

 

<HTML>

<BODY>

 

<style type="text/css">

a {text-decoration: none}

</style>

 

<% Session.lcid = 1046 %>

 

 

<font face= "tahoma" size="1" color="#666666"><b>

<%

If hour(time)<12 Then %>

Bom dia!

<% ElseIf hour(time)<18 Then %>

Boa tarde!

<% Else %>

Boa Noite!

<% End If %>

Hoje é <!--#include file=data.asp-->

e são <!--#include file=relogio.asp-->  pelo servidor.</p>

</b></font>

<%=Request.ServerVariables("LOGON_USER")%>

<%

'Response.Write Request.ServerVariables("PATH_TRANSLATED")

%>

<%

'Recupera do resultado.asp o valor das variáveis passadas

wchave=request.querystring("chave")

 

'response.write wchave

 

'1) Montar a String Para a Consulta

 

'Monta a string SQL de checagem da existencia da Licitação

strSQL = "SELECT * FROM retiedital WHERE Id_edital='" & wchave & "' "

'Response.write strSQL

 

'2) Montar a String de Conexão

 

Conexao="Provider=SQLOLEDB; Data Source=10.2.9.125; Initial Catalog=Publicar; User ID=sa; Password=''"

'response.write conexao &"<BR>"

 

'3) Criar o Objeto RecordSet

set rstMain=SERVER.CreateObject("ADODB.RecordSet")

 

'4) Abrir o RecordSet na Conexão Aplicando a cláusula SQL:

 

rstMain.OPEN strsql, conexao

 

if rstMain.EOF then

response.write "Nenhum Fornecedor retirou o Edital"

else

 

'Conecta ao BD pelo DSN e abre a consulta

'Como resultado, o recordset conterá a tabela-resposta

 

'Recupera do registro o valor das campos

 

wUF = rstMain("SG_UF")

wModal = rstMain("SG_Modalidade")

wNL = rstMain("NU_NL")

wcnpj =rstMain("NU_CNPJ")

wfornecedor = rstMain("NM_FORNECEDOR")

wnome = rstMain("NM_NOME")

wemail = rstMain("NM_EMAIL")

wtelefone = rstMain("NU_TELEFONE")

wretirado = rstMain("DT_RETHORA")

%>

 

<p align="center"><font face= "Trebuchet MS" size= "3" color=#3333CC>Fornecedores que retiraram o Edital <%=wchave%></font>

<p></p>

 

<table border=0 align=center rules=all cellspacing=3 Width=100%>

 

<TR bgcolor=#FFFF99>

<td align=center><font face= "Trebuchet MS" size= "2" color="#800000">CNPJ</font></td>

<td align=center><font face= "Trebuchet MS" size= "2" color="#800000">Fornecedor</font></td>

<td align=center><font face= "Trebuchet MS" size= "2" color="#800000">Nome</font></td>

<td align=center><font face= "Trebuchet MS" size= "2" color="#800000">Email</font></td>

<td align=center><font face= "Trebuchet MS" size= "2" color="#800000">Telefone</font></td>

<td align=center><font face= "Trebuchet MS" size= "2" color="#800000">Retirado em:</font></td>

</TR>

 

<%

nu_cnpj=""

corlinha=""

do while NOT rstMain.EOF

%>

 

<% wcnpj=rstMain("nu_cnpj")

If wcnpj=nu_cnpj then

wcnpj=""

corlinha="white"

Else

nu_cnpj=wcnpj

corlinha="#FFCC99"

End if%>

 

<TR>

<td align=center bgcolor=<%=corlinha%>><font face= "tahoma" size= "1" color="#000080"><B><%=wcnpj%></B></td>

<td align=justify><font face="arial" size= "1" color="#000080"><B><%=wfornecedor%></B></td>

<td align=center><font face="arial" size="1" color="blue"><B><%=wnome%></B></td>

<td align=center><font face= "arial" size= "1" color="#000080"><B><%=wemail%></B></font></td>

<td align=center><font face= "arial" size= "1" color="#000080"><B><%=wtelefone%></B></font></td>

<td align=center><font face= "arial" size= "1" color="#000080"><B><%=wretirado%></B></font></td>

</TR>

 

<%

' Move para o próximo registro

rstMain.movenext

Loop

%>

</table>

 

<%

rstMain.Close

 

End if

'Libera a memória (destrói o objeto recordset)

Set rstMain=Nothing

%>

 

<BR><BR>

<!--#include file="rodapeIntranet.htm"-->

<BR><BR>

<!--include file = "mostra_codigo.inc"-->

</BODY>

</HTML>

 

[/code]

Compartilhar este post


Link para o post
Compartilhar em outros sites

As suas variáveis que vem do RecordSet devem ser "alimentadas" dentro do While.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.