Technical Information (for support personnel)
Error Type:
ADODB.Recordset (0x800A0E79)
Operation is not allowed when the object is open.
/suprimentos/publicar/gravarResultado.asp, line 71
<html> <head> <title>Execução do Incluir</title> </head> <body style="font-family: Verdana, Arial"> <p> <h2>Inclusão de itens de licitação</h2> <hr> <% 'Recupera do Inclu_ResultSQLnovo.asp o valor das variáveis passadas wUF = Request.form("SG_UF") wModal = Request.form("SG_Modalidade") wNL = Request.form("NU_NL") wPublicar = Request.form("DT_Publicar") wFornecedor = Request.form("NM_Fornecedor") wItem = Request.form("NU_Item") wObjeto = Request.form("TE_Objeto") wValor = Request.form("VL_Valor") wStatus = Request.form("NM_Status") 'response.write wuf & "<BR>" & wmodal & "<BR>" & wnl & "<BR>" & wpublicar & "<BR>" & wfornecedor & "<BR>" & witem & "<BR>" & wobjeto & "<BR>" & wvalor & "<BR>" & wstatus & "<BR>" ' Mostra a variável de conexão Conexao="Provider=SQLOLEDB; Data Source=10.2.9.125; Initial Catalog=Publicar; User ID=sa; Password=''" 'response.end 'Cria um objeto recordset set rstMain = Server.CreateObject("ADODB.Recordset") <!---- Inicio Verificando Duplicidade ----> ' Passo 1 - Converter (NU_NL, NU_ITEM) String para Número. wNL2=CDbl(wNL) wITEM2=CDbl(wITEM) ' Passo 2 - montar a cláusula SQL para checar se a licitação já está cadastrada strSQL = "SELECT * FROM Resultado INNER JOIN ResuItem ON Resultado.ID_Edital = ResuItem.ID_Edital WHERE resultado.sg_uf='" & wuf & "' AND resultado.sg_modalidade='" & wmodal & "' AND resultado.nu_nl='" & wnl2 & "' AND resuitem.nu_item='" & witem2 & "'" ' Passo 3 - fazer a consulta e ver se existe ou não rstMain.Open strSQL,conexao If not rstMain.EOF then ' Se entrar no if, é porque já existe - não pode incluir %> <h5 align=center><font face="Verdana" color=#463EDD>A inclusão não foi efetuada. Já existe o item <U>"<%=witem2%>"</U> no resultado da licitação <U>"<%=wuf&"-"&wmodal&"-"&wnl%>"</U></FONT></h5> <h5 align=center><a href="javascript:history.back()">Retorne para a página anterior e acerte.</a></h5> </body> </html> <% Else wentrada = now() wID_Edital =wuf&wmodal&wnl 'MONTA A STRING SQL DE INCLUSÃO NA TABELA PUBLICAR strSQL = "INSERT INTO resultado ( SG_UF, SG_MODALIDADE, NU_NL, DT_PUBLICAR, TE_ENTRADA, NM_STATUS, ID_EDITAL) " &_ " VALUES ('"& wuf &"' , '"& wmodal &"' , '"& wnl &"' , '"& wpublicar &"' , '" & wentrada &"', '" & wstatus &"', '" & wid_edital & "')" response.write strSQL &"<BR>" 'response.end rstMain.Open strSQL,conexao 'Cria um objeto recordset set rstMain = Server.CreateObject("ADODB.Recordset") wentrada = now() wID_Edital =wuf&wmodal&wnl 'MONTA A STRING SQL DE INCLUSÃO NA TABELA PUBLICAR strSQL = "INSERT INTO resuitem (SG_UF, SG_MODALIDADE, NU_NL, NU_ITEM, NM_FORNECEDOR, TE_OBJETO, VL_VALOR, TE_ENTRADA, NM_STATUS, ID_EDITAL) " &_ " VALUES ('"& wuf &"', '" & wmodal &"', '" & wnl &"', '" & witem & "', '"& wfornecedor & "','" & wobjeto &"', '" & wvalor & "' , '" & wentrada &"', '" & wstatus &"', '" & wid_edital & "')" response.write strSQL &"<BR>" 'response.end rstMain.Open strSQL,conexao chave="?sg_uf=" & wuf & "&sg_modalidade=" & wmodal & "&nu_nl=" & wnl %> <h2>A inclusão foi efetuada.</h2> <hr> <% rstMain.Close Set rstMain=Nothing response.end End if %> <a href="Inclu_ResultSQLItem.asp<%=chave%>">Deseja lançar mais algum item?</a> <a href="home1.asp">Sair</a> </p> <!--#include file = "mostra_codigo.inc"--> </body> </html>