Olá amigos , boa noite. Bom estou com uma mega dúvida, trabalho com suporte na empresa , porém o pessoal acha que quem faz informática é obrigado a saber TUDO na área, bom eu entendo um pouquinho de ASP com ACCESS , só que lá na empresa me deram uma parada pra eu fazer em 1 semana, é uma página da intranet deles porém com ASP + SQL SERVER , e pra piorar me deram um código pronto de uma cara que era programador em ASP , o que está acontecendo, estou boiando no código. Bom o que eles querem é dar uma enxugada no sistema , querem tirar campos que não servem pra nada , estou fazendo isso porém está dando erro , quando clico em gravar não esta enviando nada , apenas fica encrito "ERRO NA PÁGINA" , e pra piorar mais ainda no código não sei em que tabela os dados estão sendo gravados , pois no access é mole , é só ver o código "strSQL = "INSERT INTO cadastro (nome , idade)" strSQL = strSQL + " VALUES ('"& nome &"','"& idade &"')" e já no SQL não consigo enxergar em qual tabela os dados estão indo, sei qual o banco pois existe uma INCLUDE( conexao ) no código. alguém pode me ajudar, please ?? Estou querendo entender o que o código está kerendo dizer e se possível alguém da uma enxugada pra mim sem que de erro ao jogar os dados na tabela: Este é o Código: <html>
<!--#include file="../../include/menu.asp"-->
<!--#include file="../../include/conexao.asp"-->
<head>
<script Language="JavaScript">
function loadPage(pageURL){
location.href = pageURL.options[pageURL.selectedIndex].value
}
</SCRIPT>
<LINK rel="stylesheet" type="text/css" href="../../controle.css">
<%
if request("cav") = "" then
strcav = ""
else
strcav = "checked"
end if
%>
<script>
function f_questions()
{
if (this.document.FrmInc.data.value == "")
{alert("Informe a data !")
document.FrmInc.data.focus();
return false;}
if (this.document.FrmInc.unidade.value == "")
{alert("Informe a unidade !")
document.FrmInc.unidade.focus();
return false;}
if (this.document.FrmInc.equipe.value == "")
{alert("Informe a equipe !")
document.FrmInc.equipe.focus();
return false;}
if (this.document.FrmInc.fornecedor.value == "")
{alert("Informe o fornecedor !")
document.FrmInc.fornecedor.focus();
return false;}
if (this.document.FrmInc.equipamento.value == "")
{alert("Informe o equipamento !")
document.FrmInc.equipamento.focus();
return false;}
if (this.document.FrmInc.modelo.value == "")
{alert("Informe o modelo !")
document.FrmInc.modelo.focus();
return false;}
if (this.document.FrmInc.localizacao.value == "")
{alert("Informe a localização !")
document.FrmInc.localizacao.focus();
return false;}
if (this.document.FrmInc.equipamentoep.value == "")
{alert("Informe o nome do Equipamento !")
document.FrmInc.equipamentoep.focus();
return false;}
document.FrmInc.strimpri.value = '';
document.FrmInc.action = 'IncluirestacaoFinanceira.asp?Op=I&Tipo=';
FrmInc.submit();
}
</script>
<script>
function f_impri()
{
document.FrmInc.strimpri.value = 'imprimir';
FrmInc.submit();
}
</script>
<script>
function f_Muda()
{
document.FrmInc.nomeequipe.value = document.FrmInc.equipe.value;
document.FrmInc.nomefornecedor.value = document.FrmInc.fornecedor.value;
document.FrmInc.nomeequipamento.value = document.FrmInc.equipamento.value;
// document.FrmInc.nomemodelo.value = document.FrmInc.modelo.value;
document.FrmInc.nomeunidade.value = document.FrmInc.unidade.value;
document.FrmInc.marca.value = document.FrmInc.fornecedor.value;
document.FrmInc.marcaep.value = document.FrmInc.fornecedor.value;
document.FrmInc.action = 'estacaoFinanceira.asp';
FrmInc.submit();
}
</script>
<title>Cadastro Alocação de Estação Financeira</title>
<LINK rel="stylesheet" type="text/css" href="../../siate.css">
<script LANGUAGE="JavaScript" src="../../include/Confirmacao.js"></script>
<body>
<%
on error resume next
strmodelo = split(request("modelo"),"|")
modelo = strmodelo(0)
codequipamento = strmodelo(1)
'Response.Write Request("nomeequipamento")
'Response.End
%>
<form name="FrmInc">
<input type=hidden name=projeto value="2">
<input type=hidden name=strval value="<%=request("strval")%>">
<input type=hidden name=codequipamento value="<%=request("codequipamento")%>">
<input type=hidden name=strimpri value='<%=request("strimpri")%>'>
<input type=hidden name=strunidade value='<%=request("strunidade")%>'>
<input type=hidden name=nomefornecedor value='<%=request("fornecedor")%>'>
<input type=hidden name=nomeequipamento value='<%=request("nomeequipamento")%>'>
<input type=hidden name=nomeunidade value='<%=request("nomeunidade")%>'>
<input type=hidden name="nomeequipe" id="nomeequipe" value='<%=request("equipe")%>'>
<input type=hidden name="alocado" id="alocado" value='<%=request("alocado")%>'>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr class=titulo align="center">
<td width="50%">
<b>Alocação de Estação Financeira</b>
</td>
</tr>
</table><br>
<table width="90%" border="0" align="center" bordercolor="lightgrey">
<tr align="center">
<td width="18%" align="left" class=font>
<b>Unidade </b>
</td>
<td align=left class=font>
<select id=unidade name=unidade onchange=java script:f_Muda();>
<option>= Selecione a Unidade =</option>
<%
Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM TB_UNIDADES"
RS.Open sql, cn
Do While Not RS.Eof
if request("nomeunidade") = RS.Fields("unidade") then%>
<option selected value='<%=RS.Fields("unidade")%>'><%=RS.Fields("Codunidade")& " - " & RS.fields("unidade")%></option>
<%else%>
<option value='<%=RS.Fields("unidade")%>'><%=RS.Fields("Codunidade")& " - " & RS.fields("unidade")%></option>
<%end if
RS.movenext
loop
RS.close
%>
</select>
</td>
<TD class=font><b>Data </b>
<INPUT NAME="data" VALUE="<%=request("data")%>" size="7">
</TD>
</tr>
<tr align="center">
<td align="left" class=font>
<b>Equipe Técnica</b>
</td>
<td colspan=3 align=left>
<INPUT NAME="equipe" value="<%=request("equipe")%>">
<input type=checkbox value=1 name=Cav <%=strcav%>> <b>CAV</b>
</td>
</tr>
</table>
<br>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="gray">
<tr align="center">
<td width="55%" align="left" colspan=6 class=font>
<b> 1. Identificação do Equipamento:</b>
</td>
</tr>
<%If request("strimpri") = "" then 'COMEÇO DA IMPRESSAO%>
<tr align="center" BGCOLOR=#EEEEEE>
<td width="13%" align="left" class=font>
Fornecedor
</td>
<td width="13%" align="left" class=font>
Equipamento
</td>
<td width="13%" align="left" class=font>
Modelo
</td>
</tr>
<tr align="center" BGCOLOR=#EEEEEE>
<td align="center" class=font>
<SELECT id=fornecedor name=fornecedor onchange=java script:f_Muda();>
<OPTION value="" selected>=Fornecedor=</OPTION>
<%
Set RSdi = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT Codfornecedor,fornecedor FROM TB_FORNECEDORES ORDER BY FORNECEDOR"
RSdi.Open sql, cn
Do While Not RSDi.Eof
if request("nomefornecedor") = RSDi.Fields("fornecedor") then%>
<option selected value='<%=RSDi.Fields("fornecedor")%>'><%=RSDi.fields("fornecedor")%></option>
<%else%>
<option value='<%=RSDi.Fields("fornecedor")%>'><%=RSDi.fields("fornecedor")%></option>
<%end if
RSDi.movenext
loop
RSDi.close%>
</select>
</td>
<td align="center" >
<SELECT id=equipamento name=equipamento onchange=java script:f_Muda();>
<OPTION value="" selected>=Equipamento=</OPTION>
<%
Set RSdi = Server.CreateObject("ADODB.Recordset")
sql = "SELECT TB_EQUIPAMENTO.Descricao, TB_FORNECEDORES.Fornecedor "
sql = sql & "FROM TB_EQUIPAMENTO INNER JOIN TB_FORNECEDORES ON "
sql = sql & "TB_EQUIPAMENTO.CodFornecedor = TB_FORNECEDORES.CodFornecedor "
sql = sql & "GROUP BY TB_EQUIPAMENTO.Descricao, TB_FORNECEDORES.Fornecedor "
sql = sql & "HAVING (TB_FORNECEDORES.Fornecedor = '"& request("nomefornecedor")&"')"
RSdi.Open sql, cn
Do While Not RSDi.Eof
if request("nomeequipamento") = RSDi.Fields("Descricao") then %>
<option selected value='<%=RSDi.Fields("Descricao")%>'><%=RSDi.fields("Descricao")%></option>
<%else%>
<option value='<%=RSDi.Fields("Descricao")%>'><%=RSDi.fields("Descricao")%></option>
<%end if
RSDi.movenext
loop
RSDi.close%>
</select>
</td>
<td align="left">
<SELECT id=modelo name=modelo onchange=java script:f_Muda();>
<OPTION value="" selected>=Modelo=</OPTION>
<%
Set RSdi = Server.CreateObject("ADODB.Recordset")
sql2 ="SELECT distinct TB_FORNECEDORES.Fornecedor,TB_EQUIPAMENTO.Modelo,TB_EQUIPAMENTO.CodEquipamento FROM TB_EQUIPAMENTO INNER JOIN "
sql2 = sql2 & "TB_FORNECEDORES ON TB_EQUIPAMENTO.CodFornecedor = TB_FORNECEDORES.CodFornecedor "
sql2 = sql2 & "WHERE (TB_Equipamento.descricao ='"& request("equipamento")&"') GROUP BY TB_FORNECEDORES.Fornecedor,TB_EQUIPAMENTO.CodEquipamento, "
sql2 = sql2 & "TB_EQUIPAMENTO.Modelo HAVING (TB_FORNECEDORES.Fornecedor ='"& request("nomefornecedor")&"')"
RSdi.Open sql2, cn
Do While Not RSDi.Eof
if modelo = RSdi("modelo") then%>
<option selected value='<%=RSdi("Modelo")&"|"&RSdi("codequipamento")%>'><%=RSdi("Modelo")%></option>
<%else%>
<option value='<%=RSdi("Modelo")&"|"&RSdi("codequipamento")%>'><%=RSdi("Modelo")%></option>
<%end if
RSDi.movenext
loop
RSDi.close
%>
</select>
</td>
</tr>
</table>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="gray">
<tr BGCOLOR=#EEEEEE>
<td width="10%" align="left" class=font>
Lacre
</td>
<td width="10%" align="left" class=font>
Patrimonio
</td>
<td width="10%" align="left" class=font>
Num Série
</td>
<td width="10%" align="left" class=font>
End. Lógico
</td>
<td width="10%" align="left" class=font>
Localização
</td>
</tr>
<tr BGCOLOR=#EEEEEE>
<td align="left" class=font>
<input type=hidden name="marca" size=19 value="<%=request("marca")%>" maxlength="19">
<input name="lacre" size=19 value="<%=request("lacre")%>" maxlength="19">
</td>
<td align="left" class=font>
<input name="patrimonio" size=19 value="<%=request("patrimonio")%>" maxlength="19">
</td>
<td align="left" class=font>
<input name="serie" size=19 value="<%=request("serie")%>">
</td>
<td align="left" class=font>
<input name="endlogico" size=19 value="<%=request("endlogico")%>">
</td>
<td align="left" class=font >
<select id="localizacao" name="localizacao">
<option VALUE="">= Localização =</option>
<%
Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM TB_LOCALIZACAO"
RS.Open sql, cn,3,1,1
Do While Not RS.Eof
If RS.Fields("CODIGO") = Cint(Request("localizacao")) Then%>
<option selected value="<%=RS.Fields("CODIGO")%>"><%=RS.Fields("DESCRICAO")%></option>
<%Else%>
<option value="<%=RS.Fields("CODIGO")%>"><%=RS.Fields("DESCRICAO")%></option>
<%End If
RS.movenext
loop
RS.close
%>
</select>
</td>
</tr>
</table>
<BR>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="gray">
<tr>
<td width="10%" align="left" class=font colspan=5>
<b>Periféricos do equipamento: </b> <font color="royalblue"><%=request("equipamento")%> </font><b>Modelo:</b> <font color="royalblue"><%= modelo%></font>
</td>
</tr>
<tr BGCOLOR=#EEEEEE>
<td width="10%" align="left" class=font>
Equipamento
</td>
<td width="10%" align="left" class=font>
Marca
</td>
<td width="10%" align="left" class=font>
Modelo
</td>
<td width="10%" align="left" class=font>
Num. Série
</td>
<td width="10%" align="left" class=font>
Patrimônio
</td>
</tr>
<tr BGCOLOR=#EEEEEE>
<td align="left" class=font>
<select name=equipamentoep>
<option value="">= Equipamento =</option>
<option value="Impressora">Impressora</option>
<option value="Leitora">Leitora</option>
<option value="PIN">PIN</option>
<option value="não POSSUI">NÃO POSSUI</option>
</select>
</td>
<td align="left" class=font>
<input name="marcaep" size=19 value="<%=request("marcaep")%>" maxlength="19">
</td>
<td align="left" class=font>
<input name="modeloep" size=19 value="<%=request("modeloep")%>">
</td>
<td align="left" class=font>
<input name="numserieep" size=19 value="<%=request("numserieep")%>">
</td>
<td align="left" class=font>
<input name="patrimonioep" size=19 value="<%=request("patrimonioep")%>">
</td>
</tr>
</table>
<%
IF REQUEST("strUNIDADE") <> "" THEN
Set rs4 = server.CreateObject("adodb.recordset")
SQL4 = "SELECT CODIGO FROM TB_ALOCADO WHERE CODUNIDADE = " & request("strUNIDADE") & " AND PROJETO = 2"
SQL4 = SQL4 & " AND NSERIE = '" & request("serie") & "'"
SQL4 = SQL4 & " AND endlogico = '" & request("endlogico") & "'"
SQL4 = SQL4 & " AND codfornecedor = '" & request("codfornecedor") & "'"
SQL4 = SQL4 & " AND modelo = '" & modelo & "'"
SQL4 = SQL4 & " AND patrimonio = '" & request("patrimonio") & "'"
rs4.Open sql4,cn,3,1,1
'Response.Write SQL4
CODIGOALOCADO = rs4("CODIGO")
If CODIGOALOCADO = "" Then
CODIGOALOCADO = "0"
else
CODIGOALOCADO = CODIGOALOCADO
end if
Set rs2 = server.CreateObject("adodb.recordset")
SQL2 = "SELECT * FROM TB_ESTACAOFINANCEIRA WHERE CODALOCADO = " & CODIGOALOCADO
'Response.Write SQL2
'Response.End
'SQL2 = SQL2 & " AND CODEQUIPAMENTO = " & request("codequipamento")
rs2.Open sql2,cn,3,1,1 %>
</table>
<br>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="gray">
<tr BGCOLOR=#EEEEEE>
<td width="10%" align="left" class=font>
End. Lógico
</td>
<td width="10%" align="left" class=font>
Marca
</td>
<td width="20%" align="left" class=font>
Modelo
</td>
<td width="15%" align="left" class=font>
N/S
</td>
<td width="15%" align="left" class=font>
Patrimônio
</td>
<td width="10%" align="left" class=font>
Excluir
</td>
</tr><%
Do While not rs2.EOF%>
<tr >
<td width="5%" align="left" class=font>
<%=rs2.Fields ("EQUIPAMENTO")%>
</td>
<td width="10%" align="left" class=font>
<%=rs2.Fields("marca")%>
</td>
<td width="20%" align="left" class=font>
<%=rs2.Fields("modelo")%>
</td>
<td width="15%" align="left" class=font>
<%=rs2.Fields ("numserie")%>
</td>
<td width="15%" align="left" class=font>
<%=rs2.Fields ("patrimonio")%>
</td>
<td width="10%" align="left" class=font>
<a href="Excluirestacaofinanceira.asp?Op=I&lacre=<%=request("lacre")%>&nomeequipamento=<%=request("nomeequipamento")%>&codfornecedor=<%=request("codfornecedor")%>&codigo=<%=rs2.fields("Codigoestacaofinanceira")%>&codequipamento=<%= strmodelo(1)%>&modelo=<%=modelo%>&projeto=2&nomeunidade=<%=request("nomeunidade")%>&equipe=<%=request("equipe")%>&strunidade=<%=request("strunidade")%>&equipamento=<%=request("equipamento")%>&nomefornecedor=<%=request("nomefornecedor")%>&data=<%=request("data")%>&patrimonio=<%=request("patrimonio")%>&serie=<%=request("serie")%>&endlogico=<%=request("endlogico")%>&localizacao=<%=request("localizacao")%>&marca=<%=request("marca")%>"
value="<%=rs2.Fields("Modelo")%>"
onclick="Confirmacao('do serviço ',this,'estacaofinanceira.asp?Op=I&lacre=<%=request("lacre")%>&nomeequipamento=<%=request("nomeequipamento")%>&codfornecedor=<%=request("codfornecedor")%>&codigo=<%=rs2.fields("Codigoestacaofinanceira")%>&projeto=2&nomeunidade=<%=request("nomeunidade")%>&equipe=<%=request("equipe")%>&strunidade=<%=request("strunidade")%>&equipamento=<%=request("Equipamento")%>&codequipamento=<%=codequipamento%>&modelo=<%= strmodelo(0)%>&nomefornecedor=<%=request("nomefornecedor")%>&data=<%=request("data")%>&patrimonio=<%=request("patrimonio")%>&serie=<%=request("serie")%>&endlogico=<%=request("endlogico")%>&localizacao=<%=request("localizacao")%>&marca=<%=request("marca")%>');">
<img width=15 height=15 border=0 src="../../Images/cancel_rd.gif" name="excluir" onclick="f_excluir()" title="Excluir" style="cursor : hand;">
</td>
</tr>
<%rs2.MoveNext
loop
End if%>
</table><BR>
<%else
IF REQUEST("strUNIDADE") <> "" THEN
Set rs2 = server.CreateObject("adodb.recordset")
SQL2 = "SELECT * FROM TB_ALOCADO WHERE CODUNIDADE = " & request("strUNIDADE")&" AND PROJETO = 2"
cn.execute sql2
rs2.Open sql2,cn,3,1,1 %>
</table>
<BR><BR>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="gray">
<tr BGCOLOR=#EEEEEE>
<td width="5%" align="left" class=font>
<B>Tipo</B>
</td>
<td width="10%" align="left" class=font>
<B>End. Lógico</B>
</td>
<td width="10%" align="left" class=font>
<B>Marca</B>
</td>
<td width="20%" align="left" class=font>
<B>Modelo</B>
</td>
<td width="15%" align="left" class=font>
<B>N/S</B>
</td>
<td width="15%" align="left" class=font>
<B>Patrimônio</B>
</td>
</tr><%
Do While not rs2.EOF%>
<tr >
<td width="5%" align="left" class=font>
<%=rs2.Fields ("Tipo")%>
</td>
<td width="10%" align="left" class=font>
<%=rs2.Fields ("endlogico")%>
</td>
<td width="10%" align="left" class=font>
<%=rs2.Fields ("marca")%>
</td>
<td width="20%" align="left" class=font>
<%=rs2.Fields ("modelo")%>
</td>
<td width="15%" align="left" class=font>
<%=rs2.Fields ("nserie")%>
</td>
<td width="15%" align="left" class=font>
<%=rs2.Fields ("patrimonio")%>
</td>
</tr>
<%rs2.MoveNext
loop
End if%>
</TABLE>
<script>
{
window.print();
}
</SCRIPT>
<%end if' FIM DA IMPRESSAO%>
<BR><BR>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="gray">
<tr align="left">
<td align="left" colspan=2 cellspacing="2" class=font>
<b>2. Comentários adicionais:</B>
<td align="left">
</tr>
<tr align="left">
<td colspan=3>
<TEXTAREA id=TEXTAREA1 name=obs rows=6 cols=110><%=request("obs")%></TEXTAREA>
</td>
</td>
</tr>
<tr align="center" class=controle>
<td colspan=3>
<input type=button id="button" name="button" value=Gravar onclick="java script:f_questions();">
</td>
</td>
</tr>
</table><br>
</form>
</body>
</html> BOM com este código me gera este formulário : e eu queria tirar este campos sem que de erro: Muito Obrigado e uma boa noite para todos. Abraços