<html> <head> <script language="javascript"> function valida_campo() { var vnuProduto= document.form.vnuProduto.value if (vnuProduto==0){ alert("Selecione o Produto!"); document.form.vnuProduto.focus() return false } var vAltura= document.form.vAltura.value if (vAltura==0){ alert("Altura deve ser informada!"); document.form.vAltura.focus() return false } var vLargura= document.form.vLargura.value if (vLargura==0){ alert("LArgura deve ser informada!"); document.form.vLargura.focus() return false } var vQuantidade= document.form.vQuantidade.value if (vQuantidade==0){ alert("Quantidade deve ser informada!"); document.form.vQuantidade.focus() return false } } </script> <style> body { scrollbar-shadow-color: #96011C; scrollbar-face-color: #BF0223; scrollbar-3dlight-color: #000000; scrollbar-highlight-color: #96011C; scrollbar-darkshadow-color: #000000; scrollbar-track-color: #BC4B1B; scrollbar-arrow-color: #ffffff; text-decoration:none; } </style> </head> <!--#include file="conecta.asp"--> <% AbreConexao Ip=Request.ServerVariables("REMOTE_ADDR")%> <%Dim Sql, RS Sql = "SELECT * FROM Produtos" set Rs = conexao.execute(sql) %> <body> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="50%"> <form method=post onsubmit="return valida_campo()" name="form" onsubmit="valida_campo()"> <tr> <td width="100%"> <p align="center"><i><b><font color="#BC4B1B">Selecione o Modelo</font></b></i> <select size="1" name="vnuProduto"> <option selected value="0">Selecione <% While not RS.EOF %> <option value="<% =RS("Id") %>"><% =RS("Produto")%></option> <% RS.MoveNext Wend set RS = Nothing %> </select></p> <p align="center"><font color="#BC4B1B"><i><b>Digite a Altura</b></i> </font> <input name=vAltura size="14"></p> <p align="center"><i><b><font color="#BC4B1B">Digite a Largura</font></b></i> <input name=vLargura size="14"></p> <p align="center"><i><b><font color="#BC4B1B">Quantidade </font></b></i> <input name=vQuantidade size="14"></p> <p align="center"> <input type="hidden" name=enviando size="100" value="sim" > <input type="submit" name=enviar size="100" value="Enviar"></p> </td> </tr> </form> </table> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="20"> <tr> <td width="9%" bgcolor="#BF0223" align="center" height="10" ><p align="center"><font color="#FFFFFF"><i><b>Quantidade</b></i></font></td> <td width="56%" bgcolor="#BF0223" align="center" height="10"><font color="#FFFFFF"><i><b>Produtos</b></i></font></td> <td width="10%" bgcolor="#BF0223" align="center" height="10"><font color="#FFFFFF"><i><b>Medidas</b></i></font></td> <td width="12%" bgcolor="#BF0223" align="center" height="10"><font color="#FFFFFF"><i><b>Preço Unitario</b></i></font></td> <td width="13%" bgcolor="#BF0223" align="center" height="10"><font color="#FFFFFF"><i><b>Sub Total</b></i></font></td> </tr> <% Dim Sqltmp, RStmp, Qtd, Idroduto,Altura, Largura, preço, SubTotal, Total if Request.form("enviando") = "sim" then Sqltmp = "insert into Tmp (Ipuser,Qtd,Idproduto,Altura,Largura) Select '" & Request.ServerVariables("REMOTE_ADDR") & "'," & int(Request.Form("vQuantidade")) & ",'" & int(Request.Form("vnuProduto")) & "'," & Replace(request.form("vAltura"),",",".") & "," & Replace(Request.Form("vLargura"),",",".") conexao.execute(Sqltmp) end if ' Sqltmp = "SELECT * FROM Tmp Where Ipuser='" & Request.ServerVariables("REMOTE_ADDR") & "'" Sqltmp = "SELECT Tmp.Ipuser, Tmp.Idproduto, Tmp.Qtd, Produtos.Produto, Produtos.preço, Tmp.Altura, Tmp.Largura, [altura]*[largura] AS m2, [m2]*[preço] AS PrecoVenda" Sqltmp = Sqltmp & " FROM Tmp LEFT JOIN Produtos ON Tmp.Idproduto = Produtos.Id" Sqltmp = Sqltmp & " WHERE (((Tmp.Ipuser)='" & Request.ServerVariables("REMOTE_ADDR") & "'));" set Rstmp = conexao.execute(Sqltmp) if not Rstmp.EOF then Qtd=Rstmp("Qtd") Produto=Rstmp("Idproduto") Altura=Rstmp("Altura") Largura=Rstmp("Largura") Do While not Rstmp.Eof SubTotal = Qtd * Rstmp("PrecoVenda") Total= Total + SubTotal %> <tr> <td width="9%" align="center" height="10"><%=Rstmp("Qtd")%> </td> <td width="56%" align="center" height="10"><%=Rstmp("Produto")%> </td> <td width="10%" align="center" height="10"><%=Rstmp("Altura")%> m x <%=Rstmp("Largura")%> m</td> <td width="10%" align="center" height="10">R$ <%=FormatNumber(Rstmp("PrecoVenda"),2)%></td> <td width="10%" align="center" height="10">R$ <%=FormatNumber(SubTotal,2)%></td> </tr> <input type=hidden name=enviando value=sim> <%RsTmp.MoveNext Loop%> <tr> <td width="9%" align="center" height="10"></td> <td width="56%" align="center" height="10"></td> <td width="10%" align="center" height="10"></td> <td width="12%" align="center" height="10" bgcolor="#BF0223"><i><b> <font color="#FFFFFF">Total</font></b></i></td> <td width="13%" align="left" height="15"> <p align="center"> <font color="#000000"><b><i>R$ <%=FormatNumber(Total,2)%></i></b></font></td> </tr> <% end if%> </table> <% FechaConexao%> </Body> </html> Estou Criando dessa forma. E para deletar eu tenho na pagina inicial function del(){ window.open ("del.asp"); } <body onunload="del()""> inicio codigo del.asp <!--#include file="conecta.asp"--> <% AbreConexao Sqld = "DELETE * FROM Tmp Where Ipuser='" & Request.ServerVariables("REMOTE_ADDR") & "'" conexao.execute(Sqld) %> fim codigo del.asp estou postando acima bem certinho como é o meu codigo. Não sei se estou fazendo certo pois tenho pouco conhecimento de asp. Se o pessoal puder me corrigir eu agradeço.