Ir para conteúdo
Fórum Script Brasil

marcelolima

Membros
  • Total de itens

    97
  • Registro em

  • Última visita

Sobre marcelolima

marcelolima's Achievements

0

Reputação

  1. marcelolima

    Sintaxe...

    ahh tahh então me manda zipado no email... daí eu tento colocar o q tu arrumou pra ver se funciona!
  2. marcelolima

    Sintaxe...

    estranho mesmo!!! aproveitei esse código aí... fiz o q você disse.. e não consegui! você testou aí?
  3. marcelolima

    Sintaxe...

    to te mandando agora.. dá uma olhada... por favor!
  4. marcelolima

    Sintaxe...

    certo.. mas o problema é justamente.. não tá indo nada pro BD... nesse campo Fonte... ele não dá erro.. mas tb não inclui nada em fonte!
  5. marcelolima

    Sintaxe...

    olha o erro 85 sSQL = "INSERT INTO FORUM_MESSAGES(AUTHORNAME,TOPIC,COMMENTS,FONTE) VALUES ('" & sName &"','"& sTopic &"','"& sComments &"','"& Fontes & "')" 87 conn.execute sSQL mas repara numa coisa... na página de erro... viu q Fontes=teste???
  6. marcelolima

    Sintaxe...

    essa aí é a página PreViewMessage...
  7. marcelolima

    Sintaxe...

    mas tá imprimindo normal... é assim q funciona ó: tem o arquivo new_post.asp que preenche os dados: <% Function prepStringForSQL(sValue) Dim sAns sAns = Replace(sValue, Chr(39), "''") sAns = "'" & sAns & "'" prepStringForSQL = sAns End Function sName = Session("Name") Function isBlank(Value) if isNull(Value) then bAns = true else bAns = trim(Value) = "" end if isBlank = bAns end function Function FixNull(Value) if isNull(Value) then sAns = "" else sAns = trim(Value) end if FixNull = sAns end function %> <HTML> <HEAD> <!--#include file = "Validate.inc"--> <TITLE></TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <link href="../estilos/intranet.css" rel="stylesheet" type="text/css"> </HEAD> <P> <center><b><font size="+1"></font></b></center><p> <FORM Name = "InputForm" ACTION = "index.asp?lcl=PreviewMess" onSubmit = 'return Validate()' METHOD = "POST"> <TABLE> <INPUT TYPE = "Hidden" NAME = "MessageType" VALUE = "NEW"> <TR> <TD class="texto"><B>Autor:</B></TD> <TD><INPUT TYPE = "TEXT" NAME="Name" SIZE="50 MAXLENGTH = "100"></TD></TR> <TR> <TD class="texto"><B>Fonte:</B></TD> <TD><INPUT NAME="Fonte" TYPE = "TEXT" id="Fonte" SIZE="50 MAXLENGTH = "100"></TD></TR> <TR> <TD class="texto"><B>T&iacute;tulo:</B></TD> <TD><INPUT TYPE = TEXT SIZE=50 MAXLENGTH="100" NAME = "Topic"></INPUT></TD></TR> <TR> <TD VALIGN = TOP class="texto"><B>Mat&eacute;ria:</B></TD> <TD VALIGN = TOP class="linkclaro"><TEXTAREA ROWS = 8 COLS = 57 NAME = "MESSAGE" class="branco"></TEXTAREA></TD></TR> </TABLE> <P> <CENTER> <INPUT TYPE = "SUBMIT" NAME = "SubmitMessage" VALUE = "Enviar" style="font-family: Verdana; font-size: 8 pt; background-color: #C4E4FD; border-style: single; border-width: 1"></FORM> <P></body> </HTML> dpois tem aquela página q te passei q recebe... perceba q no código do form, ela manda pra ela própria: <FORM ACTION = "index.asp?lcl=PreviewMess" METHOD = "POST"> e tb tá imprimindo ó: <TD><%= sFonte %></TD> agora sinceramente eu não to entendendo porque não tá indo pro bd..
  8. marcelolima

    Sintaxe...

    andreia, é o seguinte... deu certo agora... mas o problema que tá rolando é que não tá querendo incluir no BD a Fonte.. (sFonte)... que vem do Request("fonte") tem alguma idéia do que posso fazer pra inclui-lo? valeu!!!
  9. marcelolima

    Sintaxe...

    e outro problema... ele está colocando uma vírgula no final de cada campo no BD...
  10. marcelolima

    Sintaxe...

    galera funcionou... mas assim olha o que acontece agora... estou tentando incluir no BD uma coluna chamada FONTE... daí não dá erro nenhum, mas ao checar no BD.. não guardou informação... vocês podem me ajudar??? <!--#include file = "database.inc"--> <% Session("fonte") = Request("fonte") Function isBlank(Value) if isNull(Value) then bAns = true else bAns = trim(Value) = "" end if isBlank = bAns end function Function FixNull(Value) if isNull(Value) then sAns = "" else sAns = trim(Value) end if FixNull = sAns end function Function prepStringForSQL(sValue) Dim sAns sAns = Replace(sValue, Chr(39), "''") sAns = "'" & sAns & "'" prepStringForSQL = sAns End Function function ReplaceComments(sInput) dim sAns sAns = replace(sInput, " ", "&nbsp; ") sAns = replace(sAns, chr(34), "&quot;") sAns = replace(sAns, "<!--", "&lt;!--") sAns = replace(sAns, "-->", "--&gt;") ReplaceComments = sAns end function function HTMLFormat(sInput) dim sAns sAns = replace(sInput, " ", "&nbsp; ") sAns = replace(sAns, chr(34), "&quot;") sIllStart = "<" & chr(37) sIllEnd = chr(37) & ">" if instr(sAns, sIllStart) > 0 or instr(sAns, sIllEnd) > 0 then sAns = replace(sAns, "<" & chr(37), "") sAns = replace(sAns, chr(37) & ">", "") bIllegal = true end if sAns = replace(sAns, ">", "&gt;") sAns = replace(sAns, "<", "&lt;") sAns = replace(sAns, vbcrlf, "<BR>") HTMLFormat = sAns end function if Request("SubmitMessage") <> "" then bNew = true if request("SubmitReply") <> "" or request("Reply") <> "" then bReply = true if request("ApplyMessage") <> "" then bApply = true bValid = bNew or bReply or bApply if bApply then sName = request("AuthorName") sfonte = session("fonte") bAddNew = request("MessageType") = "New" if bAddNew then sTopic = prepStringForSQL(Request("Topic")) & "," sFonte = prepStringForSQL(Request("Fonte")) & "," sName = prepStringForSQL(sName) & "," sComments = ReplaceComments(Request("Message")) & "," sComments = prepStringForSQL(sComments) sSQL = "INSERT INTO FORUM_MESSAGES (AUTHORNAME,TOPIC,COMMENTS,FONTE) VALUES ('" & sName &"','"& sTopic &"','"& sComments &"','"& sFonte & "')" conn.execute sSQL sSQL = "UPDATE FORUM_MESSAGES SET THREADPARENT = ID WHERE THREADPARENT = 0" conn.execute sSQL else sOrigAuthor = Request("OrigAuthor") if sOrigAuthor = "" then sOrigAuthor = Request.QueryString("OrigAuthor") iThread = Request("ThreadID") iParent = Request("ParentID") sName = prepStringForSQL(sName) & "," sFonte = prepStringForSQL(Session("fonte")) & "," sTopic = prepStringForSQL(Request("Topic")) & "," sComments = prepStringForSQL(Request("Message")) if iThread = 0 then iThread = iParent sSQL = "INSERT INTO FORUM_MESSAGES (PARENTMESSAGE,THREADPARENT,AUTHORNAME,TOPIC,COMMENTS) VALUES (" & iParent & "," & iThread & "," & sName & sTopic & sComments & ")" conn.execute sSQL cmd.CommandText = "LASTMESSAGE" cmd.CommandType = 4 set rs = cmd.Execute sID = rs("ID") rs.close sSQL = "UPDATE FORUM_MESSAGES SET REPLYCOUNT = REPLYCOUNT + 1, LASTTHREADPOST = NOW() WHERE ID = " & iThread conn.execute sSQL end if 'bAddNew %> <!--#include file = "database_cleanup.inc"--> <% response.redirect "index.asp?lcl=noticias" end if 'bApply %> <HTML> <HEAD> <TITLE></TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <link href="../estilos/intranet.css" rel="stylesheet" type="text/css"> </HEAD> <BODY BGCOLOR = "#FFFFFF"> <% if not bValid then response.write "You cannot navigate to this page without entering a forum message. Please " response.write "return to the <A HREF = 'default.asp'>forum index</A> and try again." response.end end if 'Write to db and redirect home. response.write "<HR>" if bReply then ParentID = Request("ParentID") ThreadID = request("ThreadID") sOrigAuthor = request("OrigAuthor") end if sTopic = request("Topic") if sOrigAuthor = "" then sOrigAuthor = request.QueryString("OrigAuthor") sOrigMessage = HTMLFormat(Request("Message")) sFonte = HTMLFormat(Session("fonte")) %> <CENTER> <FONT SIZE = +2 COLOR=RED><B>Visualiza&ccedil;&atilde;o da Mat&eacute;ria</B></FONT> </CENTER> <P class="texto"> <strong>Se estiver tudo correto, por favor clique em Enviar. </strong> <P> <FORM ACTION = "index.asp?lcl=PreviewMess" METHOD = "POST"> <% if bReply Then %> <INPUT TYPE="HIDDEN" NAME="ParentID" VALUE="<%= ParentID %>"> <INPUT TYPE="HIDDEN" NAME="ThreadID" VALUE="<%= ThreadID %>"> <INPUT TYPE="HIDDEN" NAME="OrigAuthor" VALUE="<%= sOrigAuthor %>"> <% end if %> <INPUT TYPE="HIDDEN" NAME="Topic" VALUE="<%= sTopic %>"> <INPUT TYPE="HIDDEN" NAME="Message" VALUE="<%= sOrigMessage %>"> <INPUT TYPE="HIDDEN" NAME="AuthorName" VALUE="<%= Request("Name") %>"> <INPUT TYPE="HIDDEN" NAME="Fonte" VALUE="<%= sFonte %>"> <INPUT TYPE = "HIDDEN" NAME = "MessageType" <% if bReply then Response.Write "VALUE = 'REPLY'" else Response.Write "VALUE = 'New'" end if %> > <TABLE class="texto"> <TR> <TD><B>Mat&eacute;ria:</FONT></B></TD> <TD><%= sTopic %></TD> </TR> <TR> <TD>&nbsp;</TD> </TR> <TR> <TD><strong>Fonte:</strong></TD> <TD><%= Session("fonte") %></TD> </TR> <TR> <TD COLSPAN = 2>&nbsp;</TD> </TR> <TR> <TD COLSPAN = 2><B>Message:</B></TD> </TR> </TABLE> <TABLE WIDTH = 95% class="texto"><TR> <TR> <TD WIDTH = 100%> <%= sOrigMessage %> </TD></TR></TABLE><P> <CENTER><INPUT TYPE="Submit" NAME = "ApplyMessage" VALUE = "Enviar"></CENTER> <!--#include file = "footer.inc"--> </FORM> <% if bIllegal then %> <FONT COLOR = "RED" SIZE = = -1>Your message was altered to delete the ASP delimiters &lt;<%= chr(37) %> and <%= chr(37) %>&gt; </FONT><P> <% end if %> <!--#include file = "database_cleanup.inc"--> </HTML>
  11. marcelolima

    Sintaxe...

    80 sTopic = prepStringForSQL(Request("Topic")) & "," 81 sFonte = prepStringForSQL(Request("fonte")) & "," 82 sName = prepStringForSQL(sName) & "," 83 sComments = ReplaceComments(Request("Message")) & "," 84 sComments = prepStringForSQL(sComments) 85 sSQL = "INSERT INTO FORUM_MESSAGES (AUTHORNAME,TOPIC,COMMENTS) VALUES (" & sName & sTopic & sComments & ")" 86 87 conn.execute sSQL alguém pode me ajudar qual o problema??? vlw!
  12. galera.. é o seguinte... estamos desenvolvendo uma atividade de "jornal" interno... com bd. Daí acontece o seguinte.. tem o form onde o cara escreve a notícia... mas no bd não reconhece o ENTER como sendo a tag <br>... então pergunto.. tem como colocar um evento onKeyPress, onde substitua o ENTER por <br>??? Grato!!!
  13. marcelolima

    Conexão Com Oracle

    galera... era o tal do tnsnames.ora mesmo!!! agora tá rodando beleza!!! vlw pela força!
  14. galera, é o seguinte... mudamos o servidor de intra aqui no trampo... usamos dois tipos de conexões com bd... uma é MS ACCESS e a outra com ORACLE (esta segunda para pegar dados do sistema de crédito daqui). acontece que quando vai fazer alguma conexão com ORACLE, dá o seguinte erro: a linha 7 do código do erro é esta: 2 Set Conn = Server.CreateObject("ADODB.Connection") 3 4 Conn.ConnectionString = "Provider=msdaora.1;Data Source=afgo;User Id=***;Password=***" 5 6 Conn.cursorlocation=3 7 Conn.Open mudei user id e senha... pra não divulgar aqui né??? rsrsrsrs já mudei a permissão de pasta!!! O Client do Oracle tb foi instalado no servidor da intranet!!! preciso de ajuda urgente... obrigado! aguardo!!! vlw
×
×
  • Criar Novo...