Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Eai pessoa? beleza?
É o seguinte, eu tenho duas paginas em asp, uma que o cara digita os valores e a outra que insere no banco, ate ai tudo bem
o problema é que está inserindo em branco no banco, mas aparece a linha do registro
Segue o codigo
inserirvenda.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!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)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
<style type="text/css"> font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
}
.r1 {
text-align: right;
}
.r1 {
text-align: right;
}
.r1 {
text-align: right;
}</style></head>
<body>
<table width="800" height="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/layout_r3_c1.gif"><table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"> </td>
<td height="50"> </td>
<td width="50"> </td>
</tr>
<tr>
<td width="50"> </td>
<td width="700" height="300"><table width="700" height="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="170" height="90" class="r1">Nome do produto:</td>
<td height="90"><input type="text" name="produto" style="width:300px" /></td>
</tr>
<tr>
<td width="170" height="90" class="r1">Detalhes do produto:</td>
<td height="90" width="520"><textarea style="width:300px; height:150" name="detalhe"></textarea></td>
</tr>
<tr>
<td width="170" height="90" class="r1">Valor:</td>
<td height="90 width="520""><input type="text" name="preco" style="width:300px" /></td>
</tr>
<tr>
<td height="30" width="170"> </td>
<td height="30" width="520"><form method="post" action="enviarvenda.asp" "/>
<input type="submit" value="Registrar o produto" style="width:200px"/>
</form> </td>
</tr>
</table></td>
<td width="50"> </td>
</tr>
<tr>
<td width="50"> </td>
<td height="50"> </td>
<td width="50"> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
enviarvenda.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!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)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
<%
if temp = true then
response.Redirect("index.asp")
else
'requerindo as variaveis
produto = Request.Form("produto")
detalhe = Request.Form("detalhe")
preco = Request.Form("preco")
Set cnConexao = Server.CreateObject("ADODB.Connection")
cnConexao.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("banco/banco.mdb")&";"
Set add_action = Server.CreateObject ("ADODB.Recordset")
add_action.Open "venda",cnConexao,3,3
add_action.AddNew
add_action("produto") = produto
add_action("preco") = preco
add_action("detalhe") = detalhe
add_action.Update
add_action.Close
cnConexao.Close
Set add_action = Nothing
Set cnConexao = Nothing
end if
%>
alias, alguem aqui sabe como editar os dados do banco de dados numa pagina em asp, por exemplo para um usuario editar sua senha ou usuario?
se alguem puder ajudar eu agradeço
flw
Carregando comentários...