Jump to content
Fórum Script Brasil
  • 0

Comentário Não Grava


claytonprog

Question

Pessoal! estou tentando gravar um comentário em um determnado evento só que não grava nada e não dá erro. Olhem o código abaixo:

<form action="cliente_admin.asp?action=incluir" method="post" name="inclui">

<p align="center">
<span style="font-size: 9pt"><font color="#FD680C">
<% 

If strSearch <> "" Then
   
   

strSearch = Request.QueryString("search")


Banco = "db/desing.mdb"
set conn1 = createobject("adodb.connection")  
Conn1.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath(Banco)

set rs1 = createobject("adodb.recordset") 
set rs1.activeconnection = conn1 

%> 

<%
'-----------------------------------------------------------

regs = 999 'DEFININDO A QUANTIDADE DE RESULTADOS POR PÁGINA

pagina = Request.QueryString("pagina")
If pagina = "" Then
pagina = 1
End If

Set rs1 = Server.Createobject("ADODB.RECORDSET")
set rs1.ActiveConnection = conn1
rs1.CursorType = 3
rs1.PageSize = regs


if Request.QueryString("action") = "incluir" then
   
   ComandoSQL = "INSERT INTO tblmensagem (id_evento, conteudo, data)"
   ComandoSQL = ComandoSQL & " VALUES ("
   ComandoSQL = ComandoSQL & "'" & strSearch & "',"
   ComandoSQL = ComandoSQL & "'" & request.form ("txtcomentario") & "',"    
   ComandoSQL = ComandoSQL & "'" & request.form ("txtdata") & "')"

   conn.execute (ComandoSQL)


response.redirect("cliente_admin.asp")

end if



SQL1 = "SELECT * from tblmensagem where id_evento ="&strSearch

rs1.Open sql1

total = rs1.recordcount
Colunas = 1
'-----------------------------------------------------------
%>
<br>[ Existem </font></font>
                                    <b>
        <font color="#FF0000" face="Verdana" style="font-size: 9pt">
                                    <%=total%></font></b><font size="2" face="Verdana" style="color: 000000; font-size: 9pt"> 
                                    Comentários Cadastrados. ]</font><p align="center">
<span style="font-size: 9pt"><font color="#FD680C">
&nbsp;<%
if RS1.EOF then %>



</font></font></font>
                                        <font color=#FD680C face=verdana><b>Nenhum 
comentário cadastrado</b></font><font face="Tahoma" color="#FD680C">
<% else %>  </font>
</p>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
        <td><tr><td height=60 width="724">
                                            <div align="center">
                                                <table border="0" width="723" id="table2" cellspacing="0" cellpadding="0" style="border-style: dashed; border-width: 1px" height="54">
                                                    <tr>
                                                        
                                                        
                                                        
                                                        <font face="Verdana" size="2">
                                                        </b></td>
                                                        
                                                        <td width="555" bgcolor="#EAEBEC" style="border-style: dashed; border-width: 1px" height="29">
                                                        <p align="left">
                                                        <b>
                                                        
                                                        <font face="Verdana" size="2">
                                                        &nbsp;</font></b><STRONG><font face="Verdana" size="2"><font color="#000033" face="Tahoma" size="2">::</font></font></STRONG><b><font face="Verdana" size="2">Seus </font><font face="Verdana" style="font-size: 9pt">Comentários</font></b><font face="Verdana" size="2"><STRONG><font color="#000033" face="Tahoma" size="2">:</font><FONT face=Tahoma size=2>:</FONT></STRONG></font></td>
                                                         <th bgcolor="#EAEBEC" width="164"><STRONG><FONT color=royalblue face=Tahoma size=2><font color="#000033">::
                                                          Data:</font></FONT><FONT face=Tahoma size=2>:</FONT></STRONG></th>

                                                    </tr>
<%


rs1.AbsolutePage = pagina

Cont = 0

do while not RS1.EOF AND x < rs1.PageSize

x = x + 1
Cont = cont + 1


        id = rs1("id")     
        conteudo = rs1("conteudo")        
              
      

       


IF cor ="#FFFFFF" THEN
cor = "#e8e8e8"
ELSE
cor ="#FFFFFF"
END IF
%>

<%
    
          
         %>
         </font>
        <tr bgcolor="<%=cor%>">        
        
        <td align="left" width="557">        
        <font face="Verdana" style="font-size: 9pt"><%=Rs1("conteudo")%></font>        
        <td align="center" width="164"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><%= Rs1("data")%></font></td>

        <span style="text-decoration: none; font-weight:700">    
     
     <%
     
     
        %>

                                                
<% RS1.MoveNext

loop
Cont = cont + 1

end if %>                                                        
                                                    </tr>
                                                </table>
                                            </div>
                                            </td></tr> 
                                        <tr><td height=28 width="724">
                                            <div align="center">
                                                <table width="102%" id="table3" height="28" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td bgcolor="#EAEBEC">
<b><font face="Verdana" size="2" color="#FFFFFF">
<p align="center">
<%

anterior = pagina - 1
proxima = pagina + 1
ultima = rs1.PageCount
primeira = 1
ultm2 = FormatNumber(rs1.PageCount - 1,0)
If pagina > 1 Then %> </font><font face="Verdana" size="1">
<a style="text-decoration:none" onMouseOut="window.status='';return true;" onMouseOver="window.status='Primeira Página';return true;" href=feras_full.asp?pagina=<%=primeira%>>
<span style="text-decoration: none">Inicio da Página</span></a></font><font face="Verdana" size="2">
<% End If
If pagina > 1 AND pagina > 2 Then %>
[ <a style="text-decoration:none" onMouseOut="window.status='';return true;" onMouseOver="window.status='Página <%=anterior - 1%>';return true;" href=feras_full.asp?pagina=<%=anterior - 1%>>
<span style="text-decoration: none"><%=anterior - 1%></span></a> ]
<% End If
If pagina > 1 Then %>
[ <a <a style="text-decoration:none" onMouseOut="window.status='';return true;" onMouseOver="window.status='Página <%=anterior%>';return true;" href=feras_full.asp?pagina=<%=anterior%>>
<span style="text-decoration: none"><%=anterior%></span></a> ]
<% End If %>
[ <%=pagina%> ]
<% If Not rs1.EOF Then %>
[ <a <a style="text-decoration:none" onMouseOut="window.status='';return true;" onMouseOver="window.status='Página <%=proxima%>';return true;" href=feras_full.asp?pagina=<%=proxima%>>
<span style="text-decoration: none"><%=proxima%></span></a> ]
<% End If
If Not rs1.EOF AND pagina > ultima AND pagina > ultm2 Then %>
[ <a <a style="text-decoration:none" onMouseOut="window.status='';return true;" onMouseOver="window.status='Página <%=proxima + 1%>';return true;" href=feras_full.asp?pagina=<%=proxima + 1%>>
<span style="text-decoration: none"><%=proxima + 1%></span></a> ]
<% End If

If Not rs1.EOF Then%> 
</font><font face="Verdana" size="1">
<a style="text-decoration:none" onMouseOut="window.status='';return true;" onMouseOver="window.status='Última Página';return true;" href=feras_full.asp?pagina=<%=ultima%>>
<span style="text-decoration: none">Final da Página</span></a><font color="#FFFFFF">
</font> </font>
<font face="Verdana" size="2" color="#FFFFFF">
<%
rs1.close 
conn1.close 
set rs1 = nothing 
set conn1 = nothing 
End If

End If %></font></b></td>
</tr>
              </table>
            </td>
          </tr>
<p>&nbsp;</td>
                    </tr>
    </table>
                </div>
                <p><b>Data:</b><br><input type="text" name="txtdata" size="20"><br>
                <b>Comentário:</b><br><textarea cols="50" rows="5" name="txtacomentario"></textarea> </p>
<p><input type="submit" name="btnenviar" value="Enviar"><br></p>
</form>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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
      152k
    • Total Posts
      651.5k
×
×
  • Create New...