Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Esta dando este erro Microsoft JET Database Engine (0x80040E0C) O comando de texto não foi definido para o objeto de comando.
/asp/intranet/clientedal.asp, line 11
não sei o que fazer acontece quando vou inserir novo registro, agradeço desde já atenção?
cliente.asp
<%@LANGUAGE="VBSCRIPT"%>
<%Option Explicit%>
<!--#Include File="conexao.asp"-->
<!--#Include File="clientedal.asp"-->
<!--#include file="session.asp"-->
<%
dim sql, rs
dim Vacao, Vcomando, Vcodigo, Vnome, Vend, Vcep, Vcid, Vest, Vrg, Vcpf, Vtelr, Vtelco, Vtelce, Vemail, Vdata, Vind, Vvar, Vproc, Vrecla, Vdirpf, Vsit, Vprox, Vconc, botao
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml"](http://www.w3.org/1999/xhtml) lang="pt" xml:lang="pt-br">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="language" content="pt-br" />
<title>Teste</title>
<link rel="stylesheet" href="estilos.css" type="text/css">
</head>
<body>
<div id="principal">
<!--#Include File="cabecalho.asp"-->
<!--#Include File="menu.asp"-->
<div id="conteudo">
<h2>Clientes</h2><form action="cliente.asp" method="post" >
<%
Vacao = Request("acao")
Vnome = Request("nome")
Vend = Request("ender")
Vcep = Request("cep")
Vcid = Request("cid")
Vest = Request("est")
Vrg = Request("rg")
Vcpf = Request("cpf")
Vtelr = Request("telr")
Vtelco = Request("telco")
Vtelce = Request("telce")
Vdata = Request("data")
Vemail = Request("email")
Vind = Request("indi")
Vvar = Request("var1")
Vproc = Request("pro")
Vrecla = Request("recl")
Vdirpf = Request("dir")
Vsit = Request("sit")
Vprox = Request("proxp")
Vconc = Request("conc")
Vcomando = Request.Form("comando")
Vcodigo = Request("codigo")
if Vcomando = "Gravar" then
Call Inserir(Vnome, Vend, Vcep, Vcid, Vest, Vrg, Vcpf, Vtelr, Vtelco, Vtelce, Vdata, Vemail, Vind, Vvar, Vproc, Vrecla, Vdirpf, Vsit, Vprox, Vconc)
Response.Redirect("cliente.asp")
Elseif Vcomando = "Alterar" then
Call Alterar(Vcodigo, Vnome, Vend, Vcep, Vcid, Vest, Vrg, Vcpf, Vtelr, Vtelco, Vtelce, Vdata, Vemail, Vind, Vvar, Vproc, Vrecla, Vdirpf, Vsit, Vprox, Vconc)
Response.Redirect("cliente.asp")
Elseif Vcomando = "Excluir" then
Call Excluir(Vcodigo)
Response.Redirect("cliente.asp")
end if
if Vacao = "Novo" or Vacao = "alterar" then
%>
<table summary="">
<tr>
<td>Código:</td>
<td colspan="2"><input type="text" value="<%=Vcodigo%>" name="codigo" readonly /></td>
</tr>
<tr>
<td>Nome: </td>
<td colspan="2"><input name="nome" type="text" value="<%=Vnome%>" /></td>
</tr>
<tr>
<td>Endereço: </td>
<td colspan="2"><input name="ender" type="text" value="<%=Vend%>" size="40" /></td>
</tr>
<tr>
<td>CEP: </td>
<td colspan="2"><input name="cep" type="text" value="<%=Vcep%>" size="40" /></td>
</tr>
<tr>
<td>Cidade: </td>
<td colspan="2"><input name="cid" type="text" value="<%=Vcid%>" size="40" /></td>
</tr>
<tr>
<td>Estado: </td>
<td colspan="2"><input name="est" type="text" value="<%=Vest%>" size="40" /></td>
</tr>
<tr>
<td>RG: </td>
<td colspan="2"><input name="rg" type="text" value="<%=Vrg%>" maxlength="9" /></td>
</tr>
<tr>
<td>CPF: </td>
<td colspan="2"><input name="cpf" type="text" value="<%=Vcpf%>" maxlength="11" /></td>
</tr>
<tr>
<td>Telefone: </td>
<td colspan="2"><input name="telr" type="text" value="<%=Vtelr%>" maxlength="13" /></td>
</tr>
<tr>
<td>Telefone Comercial: </td>
<td colspan="2"><input name="telco" type="text" value="<%=Vtelco%>" maxlength="13" /></td>
</tr>
<tr>
<td>Telefone Celular: </td>
<td colspan="2"><input name="telce" type="text" value="<%=Vtelce%>" maxlength="13" /></td>
</tr>
<tr>
<td>Data: <%=Vdata%> </td>
<td colspan="2">
<select name="data" onchange="<%=Vdata%>">
<option value="2008">2008</option>
<option value="2007">2007</option>
<option value="2006">2006</option>
<option value="2005">2005</option>
<option value="2004">2004</option>
<option value="2003">2003</option>
<option value="2002">2002</option>
</select>
</td>
</tr>
<tr>
<td>E-mail: </td>
<td colspan="2"><input name="email" type="text" value="<%=Vemail%>" size="40" /></td>
</tr>
<tr>
<td>Indicação: </td>
<td colspan="2"><input name="indi" type="text" value="<%=Vind%>" size="40" /></td>
</tr>
<tr>
<td>Vara: </td>
<td colspan="2"><input name="var1" type="text" value="<%=Vvar%>" size="40" /></td>
</tr>
<tr>
<td>Processo: </td>
<td colspan="2"><input name="pro" type="text" value="<%=Vproc%>" size="40" /></td>
</tr>
<tr>
<td>Reclamante: </td>
<td colspan="2"><input name="recl" type="text" value="<%=Vrecla%>" size="40" /></td>
</tr>
<tr>
<td>Dirpf: </td>
<td colspan="2"><input name="dir" type="text" value="<%=Vdirpf%>" size="40" /></td>
</tr>
<tr>
<td>Situação Atual: </td>
<td colspan="2"><input name="sit" type="text" value="<%=Vsit%>" size="40" /></td>
</tr>
<tr>
<td>Próximo Passo: </td>
<td colspan="2"><input name="proxp" type="text" value="<%=Vprox%>" size="40" /></td>
</tr>
<tr>
<td>Conclusão: </td>
<td colspan="2"><input name="conc" type="text" value="<%=Vconc%>" size="40" /></td>
</tr>
<tr>
<%
if Vacao = "Novo" then
botao = "Gravar"
else
botao = "Alterar"
end if
%>
<td colspan="2">
<input type="submit" name="comando" value="<%=botao%>"/>
<% if Vacao <> "Novo" then%>
<input type="submit" name="comando" value="Excluir"/>
<%end if%>
<input type="submit" name="voltar" value="Voltar"/>
</td>
</tr>
</table>
<%
else'Vacao = "Novo"
%>
<input type="submit" name="acao" value="Novo"/>
<%
call AbrirConexao()
sql = "Select * FROM ir order by nome_cli"
set rs = objConexao.execute(sql)
%>
<div id="cli">
<hr />
<table summary="">
<%
Do while not rs.eof
%>
<tr>
<td><a href="cliente.asp?acao=alterar&codigo=<%=rs("cli_id")%>&nome=<%=rs("nome_cli")%>&ender=<%=rs("end_cli")%>&cep=<%=rs("cep_cli")%>&cid=<%=rs("cid_cli")%>&est=<%=rs("est_cli")%>&rg=<%=rs("rg_cli")%>&cpf=<%=rs("cpf_cli")%>&telr=<%=rs("telr_cli")%>&telco=<%=rs("telco_cli")%>&telce=<%=rs("telce_cli")%>&data=<%=rs("data_cli")%>&email=<%=rs("email_cli")%>&ind=<%=rs("indicacao")%>&var1=<%=rs("vara")%>&pro=<%=rs("proc")%>&recl=<%=rs("recla")%>&dir=<%=rs("dirpf")%>&sit=<%=rs("situacao_atual")%>&proxp=<%=rs("prox_passo")%>&conc=<%=rs("concluido")%>"><%=rs("nome_cli")%></a></td>
</tr>
<%
rs.MoveNext
loop
%>
</table>
</div>
<%
rs.close
set rs = nothing'limpa damemoria
Call FecharConexao()
end if
%>
</form>
<div id="sair"><a href="encerrasessao.asp" class="conteudo">Encerrar Sessão</a></div>
</div><!-- conteudo -->
<!--#Include File="rodape.asp"-->
</div><!-- principal -->
</body>
</html>
clientedal.asp
<%
'Depto - Data Acess Layer (DAL)
'Acesso aos Dados
'==========Inserir============
Sub Inserir (nome, ender, cep, cid, est, rg, cpf, telr, telco, telce, data, email, indi, var1, pro, recl, dir, sit, proxp, conc)
Dim sql_ins
sql = "Insert Into ir (nome_cli, end_cli, cep_cli, cid_cli, est_cli, rg_cli, cpf_cli, telr_cli, telco_cli, telce_cli, data_cli, email_cli, indi, vara, proc, recla, dirpf, situacao_atual, prox_passo, concluido) VALUES ('"& nome & "', '" & ender & "', '" & cep & "', '" & cid & "', '" & est & "', '" & rg & "', '" & cpf & "', '" & telr & "', '" & telco & "', '" & telce & "', '" & data & "', '" & email & "', '" & indi & "', '" & var1 & "', '" & pro & "', '" & recl & "', '" & dir & "', '" & sit & "', '" & proxp & "', '" & conc & "')"
Call AbrirConexao()
objConexao.execute(sql_ins)
Call FecharConexao()
end Sub
'============Fim Inserir==========
'==========Alterar============
Sub Alterar (nome, ender, cep, cid, est, rg, cpf, telr, telco, telce, data, email, indi, var1, pro, recl, dir, sit, proxp, conc)
Dim sql_up
sql_up = "update ir set nome_cli = '" & nome & "', end_cli = '" & ender & "', cep_cli = '" & cep & "', cid_cli = '" & cid & "', est_cli = '" & est & "', rg_cli = '" & rg & "', cpf_cli = '" & cpf & "', telr_cli = '" & telr & "', telco_cli = '" & telco & "', telce_cli = '" & telce & "', data_cli = '" & data & "', email_cli = '" & email & "', indicacao = '" & indi & "', vara = '" & var1 & "', proc = '" & pro & "', recla = '" & recl & "', dirpf = '" & dir & "', situacao_atual = '" & sit & "', prox_passo = '" & proxp & "', concluido = '" & conc & "' where cli_id = " & codigo
Call AbrirConexao()
objConexao.execute(sql_up)
Call FecharConexao()
end Sub
'============Fim Inserir==========
'==========Exclusão============
Sub Excluir (codigo)
Dim sql_del
sql_del = "Delete from ir where cli_id = " & codigo
Call AbrirConexao()
objConexao.execute(sql_del)
Call FecharConexao()
end Sub
'============Fim Inserir==========
%>
Carregando comentários...