Jump to content
Fórum Script Brasil
  • 0

Clausula De Insert Into...


Guest carlos eduardo

Question

Guest carlos eduardo
<html>
<body>
   <%
     DIM CONEXAO, SQL
     SET CONEXAO = SERVER.CREATEOBJECT("ADODB.CONNECTION")
     CONEXAO.OPEN "confirmacao"  
     SQL = "INSERT INTO confirmacao(Particpante, email, acompanhante,sexpart, status, valtot)VALUES("
     SQL = SQL & "'" & REQUEST("part") & "',"  
     SQL = SQL & "'" & REQUEST("sexpart") & "',"  
     SQL = SQL & "'" & (Int(request("acomph")) + Int(request("acompm"))) &"',"
     SQL = SQL & "'" & REQUEST("sexpart") & "'," 
     SQL = SQL & "'" & REQUEST("status") & "'," 
     SQL = SQL & "'" & REQUEST("valtot") & "'"   
     CONEXAO.EXECUTE (SQL) 
   %>
<table border=1>
<tr>
  <td>Participante:</td>
  <td colspan=3><%=REQUEST("part")%></td>
<tr>
  <td>Sexo Partic.:</td>
  <td><%=REQUEST("sexpart")%></td>
  <td>E-mail:</td>
  <td><i><%=REQUEST("email")%></i></td>
<tr>
  <td>Nº acomp:</td>
  <td><%=Int(request("acomph")) + Int(request("acompm"))%></td>
<tr>
  <td>confirmado:</td>
  <td><%=REQUEST("status")%></td>
  <td>Valor Toatl:</td>
  <td><%=REQUEST("valtot")%></td>
</tr>
</table>
<center>Dados Inseridos com sucesso!!!</center>
</body>
</html>

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Guest carlos eduardo

a resposta q recebo é....

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][Driver ODBC para Microsoft Access] Erro de sintaxe na instrução INSERT INTO.

/carioca/inserting.asp, line 14

Link to comment
Share on other sites

  • 0

Salve

ta faltando algumas aspas ali heim... e um parentese também

SQL = "INSERT INTO confirmacao(Particpante, email, acompanhante,sexpart, status, valtot)VALUES("

SQL = SQL & "'" & REQUEST("part") & "',"

SQL = SQL & "'" & REQUEST("sexpart") & "',"

SQL = SQL & "'" & (Int(request("acomph")) + Int(request("acompm"))) &"',"

SQL = SQL & "'" & REQUEST("sexpart") & "',"

SQL = SQL & "'" & REQUEST("status") & "',"

SQL = SQL & "'" & REQUEST("valtot") & "'"

acho que nessas estão todas

SQL = "INSERT INTO confirmacao(Particpante, email, acompanhante,sexpart, status, valtot)VALUES("

SQL = SQL & "'" & REQUEST("part") & "','"

SQL = SQL & "'" & REQUEST("sexpart") & "','"

SQL = SQL & "'" & (Int(request("acomph")) + Int(request("acompm"))) &"','"

SQL = SQL & "'" & REQUEST("sexpart") & "','"

SQL = SQL & "'" & REQUEST("status") & "','"

SQL = SQL & "'" & REQUEST("valtot") & "')"

eu prefiro fazer assim, p/ ficar mais facil de ler:

SQL = "INSERT INTO confirmacao(Particpante, email, acompanhante,sexpart, status, valtot)VALUES("'" & REQUEST("part") & "','" & REQUEST("sexpart") & "','"& (Int(request("acomph")) + Int(request("acompm"))) &"','"& REQUEST("sexpart") & "','"& REQUEST("status") & "','"& REQUEST("valtot") & "')"

assim deve ta certo, eu não testei, mas deve ta

Manwë Súlimo, Senhor do Oeste

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      652k
×
×
  • Create New...