Ir para conteúdo
Fórum Script Brasil

marcelolima

Membros
  • Total de itens

    97
  • Registro em

  • Última visita

Tudo que marcelolima postou

  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
  15. marcelolima

    Status Bar...

    dá uma olhada galera... eu fiz mais ou menos assim: <html> <head> <title>Intranet - Agência de Fomento de Goiás S/A</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 leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <% Server.ScriptTimeout = 100000000 Data = (now) 'obtem o nome do arquivo informado fileExcel = request("nometxt") & ".xls" 'Substitua a barra invertica (\) pelo nome do seu diretorio virtual. 'a barra invertida indica que o arquivo vai ser procurado em wwwroot filePath = Server.mapPath("\ascom") filename = filePath & "\" & fileExcel 'Cria o arquivo com extens&atilde;o .xls usando o objeto FileSytemObject 'Se o arquivo n&atilde;o exisitir o parametro TRUE ir&aacute; permitir a sua criacao 'Esteja certo que o usuario tenha permissao para escrita no diretorio onde o 'arquivo vai ser criado Set fs = Server.CreateObject("Scripting.FileSystemObject") Set MyFile = fs.CreateTextFile(filename, True) 'Abre a conex&atilde;o e retorna os dados do banco de dados 'Set cn = Server.CreateObject("ADODB.Connection") '************************************************************************ Categoria = Request.Form("categoria") if Categoria = 1 then Set cn = Server.CreateObject("ADODB.Connection") cn.ConnectionString = "Provider=msdaora.1;Data Source=afgo;User Id=dsouza;Password=deusdede" cn.cursorlocation=3 cn.Open sql="select cli_nome, cli_fantasia, cli_endereco, cli_bairro, cli_cidade, cli_estado, cli_cep " sql=sql&"from clipfpj " sql=sql&"where exists ( " sql=sql&"select con_numero from contrato where con_cnpj=cli_cnpj " sql=sql&"and link = 0) " sql=sql&"order by 1 " Set Rs = Server.CreateObject( "ADODB.Recordset" ) RS.ActiveConnection = cn Set Rs=cn.execute (sql) end if if Categoria = 0 then cnpath="DBQ=" & Server.MapPath("dados/intranet.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set cn = Server.CreateObject("ADODB.Connection") cn.Open DataSource 'Abre o Recordset' Set Rs = Server.CreateObject( "ADODB.Recordset" ) RS.ActiveConnection = cn Set Rs=cn.execute("Select Tipo, Tratamento, Nome, Endereco, Bairro, Cep, Cidade, Estado From autoridades") end if '*********************************************************** 'Estou usando um provedor OLE DB para efetuar a conexao com o arquivo 'voce pode usar um DSN ( a linha comentada mostra a sintaxe para a conexao) 'cn.Open "DSN=dsn_biblio;UID=;PWD=;DATABASE=Biblio" 'DB="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & request("nomebd") 'SQL = " Select * from " & request("nometbl") 'cn.Open DB 'Set rs = cn.Execute(SQL) strLine="" 'incializa a variavel para armazenar o nome dos campos For each x in rs.fields 'separa os nomes dos campos com um tab para que eles possam aparecer me colunas diferentes no Excel strLine= strLine & x.name & chr(9) Next 'escreve a string no arquivo MyFile.writeline strLine inicio = timer valor = Rs.Recordcount i = 1 passados = 0 'retorna os valores do banco de dados e escreve no arquivo Do while Not rs.EOF passados = passados + 1 strLine="" If passados = 10 Then Response.Write "<script>" Response.Write "document.getElementById('txtStatus').innerHTML = 'Processamento: <b>"& FormatPercent( i / valor ) & "</b> - Registro: <b>"& i &"</b> de <b>"& valor &"</b>';" & VbCrLf Response.Write "</script>" passados = 0 End If Response.Flush() for each x in rs.Fields strLine= strLine & x.value & chr(9) next MyFile.writeline strLine rs.MoveNext Loop 'limpa o objeto MyFile.Close Set MyFile=Nothing Set fs=Nothing %> <table width="610" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <TD width=15><IMG height=8 src="imagens/1px.gif" width=8></TD> </tr> <tr> <td width="15" align="center" valign="middle"> <div align="center"><IMG height=8 src="imagens/1px.gif" width=15></div></td> <td align="center" valign="top"> <table width="580" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="#3399CC"> <td width="595" height="20" align="center" class="titulobranco">ARQUIVO PARA MALA DIRETA </td> </tr> </table> <table width="595" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="20" valign="middle" class="texto"><table width="595" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="5" colspan="4" align="LEFT" valign="middle" class="texto"><img src="fotos/imagens/5px.gif" width="10" height="5"></td> </TR> <TR> <TD height="20" colspan="4" ALIGN="center" VALIGN="middle" class="texto"><span class="tituloazul3">Arquivo texto gerado com sucesso </span> <div align="left"> </div></TD> </TR> <tr bgcolor="#FFFFFF"> <TD height="20" colspan="4" ALIGN="LEFT" VALIGN="middle" class="texto">&nbsp;</TD> </TR> <tr bgcolor="#FFFFFF"> <TD width="100" height="10" ALIGN="LEFT" VALIGN="middle" class="texto">&nbsp;</TD> <TD width="198" ALIGN="center" VALIGN="middle" class="linkclaro"> <% 'Exibe um link para abrir o arquvo no Excel link="<a href=" &"/ascom/"& fileExcel & " class=""linkclaro"">Abrir o arquivo no Excel</a>" Response.write link%> </TD> <TD width="197" ALIGN="center" VALIGN="middle" class="texto">Voltar</TD> <TD width="100" ALIGN="LEFT" VALIGN="middle" class="texto">&nbsp;</TD> </TR> </TABLE></td> </tr> <tr> <td height="5" valign="middle" class="texto"><img src="fotos/imagens/5px.gif" width="10" height="5"></td> </tr> </table> </td> </tr> </table> <p>&nbsp;</p> <p>&nbsp;</p> </body> </html> a página roda de boa.. mas com um erro... 'document.getElementById(...)' é nulo ou não é um objeto!!! sabem onde eu tenho q arrumar???
  16. marcelolima

    Status Bar...

    não entendi o que disse... brother o código que manda pra é esse: <html> <head> <title>Intranet - Agência de Fomento de Goiás S/A</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 leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="610" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <TD width=15><IMG height=8 src="imagens/1px.gif" width=8></TD> </tr> <tr> <td width="15" align="center" valign="middle"> <div align="center"><IMG height=8 src="imagens/1px.gif" width=15></div></td> <td align="center" valign="top"> <table width="580" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="#3399CC"> <td width="595" height="20" align="center" class="titulobranco">GERA ARQUIVO PARA MALA DIRETA </td> </tr> </table> <form name="frmArquivo" method="post" action="index.asp?lcl=criaarquivo"> <table width="580" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="20" colspan="2"><span class="texto">Categoria:</span></td> </tr> <tr> <td height="20" colspan="2"><span class="texto"> <select name="categoria" id="categoria" style="font-family: Verdana; font-size: 8 pt; border-style: solid; border-width: 1"> <option value="0">AUTORIDADES</option> <option value="1">CLIENTES</option> </select> </span></td> </tr> <tr> <td height="10" colspan="2"><span class="texto"><img src="../imagens/5px.gif" width="5" height="5"></span></td> </tr> <tr> <td height="20" colspan="2"><span class="texto">Nome do arquivo:</span></td> </tr> <tr> <td width="210" height="20"><input name="nometxt" type="text" id="nometxt" style="font-family: Verdana; font-size: 8 pt; border-style: solid; border-width: 1" value="MALADIRETA" size="30"></td> <td>&nbsp; </td> </tr> <tr> <td height="10" colspan="2">&nbsp;</td> </tr> <tr> <td height="10" colspan="2"><input type="submit" value="Gerar arquivo" name="LNome" style="font-family: Verdana; font-size: 8 pt; background-color: #ECF8FF; border-style: solid; border-width: 1"></td> </tr> <tr> <td height="10" colspan="2"><img src="../imagens/10px.gif" width="10" height="10"></td> </tr> </table> </form> <table width="595" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="20" valign="middle" class="texto">&nbsp;</td> </tr> <tr> <td height="5" valign="middle" class="texto"><img src="fotos/imagens/5px.gif" width="10" height="5"></td> </tr> </table> </td> </tr> </table> <p>&nbsp;</p> <p>&nbsp;</p> </body> </html> E ESSE ÚLTIMO É O RESULTADO... <html> <head> <title>Intranet - Agência de Fomento de Goiás S/A</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 leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <% Server.ScriptTimeout = 100000000 Data = (now) 'obtem o nome do arquivo informado fileExcel = request("nometxt") & ".xls" 'Substitua a barra invertica (\) pelo nome do seu diretorio virtual. 'a barra invertida indica que o arquivo vai ser procurado em wwwroot filePath = Server.mapPath("\ascom") filename = filePath & "\" & fileExcel 'Cria o arquivo com extens&atilde;o .xls usando o objeto FileSytemObject 'Se o arquivo n&atilde;o exisitir o parametro TRUE ir&aacute; permitir a sua criacao 'Esteja certo que o usuario tenha permissao para escrita no diretorio onde o 'arquivo vai ser criado Set fs = Server.CreateObject("Scripting.FileSystemObject") Set MyFile = fs.CreateTextFile(filename, True) 'Abre a conex&atilde;o e retorna os dados do banco de dados 'Set cn = Server.CreateObject("ADODB.Connection") '************************************************************************ Categoria = Request.Form("categoria") if Categoria = 1 then Set cn = Server.CreateObject("ADODB.Connection") cn.ConnectionString = "Provider=msdaora.1;Data Source=afgo;User Id=dsouza;Password=deusdede" cn.cursorlocation=3 cn.Open sql="select cli_nome, cli_fantasia, cli_endereco, cli_bairro, cli_cidade, cli_estado, cli_cep " sql=sql&"from clipfpj " sql=sql&"where exists ( " sql=sql&"select con_numero from contrato where con_cnpj=cli_cnpj " sql=sql&"and link = 0) " sql=sql&"order by 1 " Set Rs = Server.CreateObject( "ADODB.Recordset" ) RS.ActiveConnection = cn Set Rs=cn.execute (sql) end if if Categoria = 0 then cnpath="DBQ=" & Server.MapPath("dados/intranet.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set cn = Server.CreateObject("ADODB.Connection") cn.Open DataSource 'Abre o Recordset' Set Rs = Server.CreateObject( "ADODB.Recordset" ) RS.ActiveConnection = cn Set Rs=cn.execute("Select Tipo, Tratamento, Nome, Endereco, Bairro, Cep, Cidade, Estado From autoridades") end if '*********************************************************** 'Estou usando um provedor OLE DB para efetuar a conexao com o arquivo 'voce pode usar um DSN ( a linha comentada mostra a sintaxe para a conexao) 'cn.Open "DSN=dsn_biblio;UID=;PWD=;DATABASE=Biblio" 'DB="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & request("nomebd") 'SQL = " Select * from " & request("nometbl") 'cn.Open DB 'Set rs = cn.Execute(SQL) strLine="" 'incializa a variavel para armazenar o nome dos campos For each x in rs.fields 'separa os nomes dos campos com um tab para que eles possam aparecer me colunas diferentes no Excel strLine= strLine & x.name & chr(9) Next 'escreve a string no arquivo MyFile.writeline strLine 'retorna os valores do banco de dados e escreve no arquivo Do while Not rs.EOF strLine="" for each x in rs.Fields strLine= strLine & x.value & chr(9) next MyFile.writeline strLine rs.MoveNext Loop 'limpa o objeto MyFile.Close Set MyFile=Nothing Set fs=Nothing %> <table width="610" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <TD width=15><IMG height=8 src="imagens/1px.gif" width=8></TD> </tr> <tr> <td width="15" align="center" valign="middle"> <div align="center"><IMG height=8 src="imagens/1px.gif" width=15></div></td> <td align="center" valign="top"> <table width="580" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="#3399CC"> <td width="595" height="20" align="center" class="titulobranco">ARQUIVO PARA MALA DIRETA </td> </tr> </table> <table width="595" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="20" valign="middle" class="texto"><table width="595" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="5" colspan="4" align="LEFT" valign="middle" class="texto"><img src="fotos/imagens/5px.gif" width="10" height="5"></td> </TR> <TR> <TD height="20" colspan="4" ALIGN="center" VALIGN="middle" class="texto"><span class="tituloazul3">Arquivo texto gerado com sucesso </span> <div align="left"> </div></TD> </TR> <tr bgcolor="#FFFFFF"> <TD height="20" colspan="4" ALIGN="LEFT" VALIGN="middle" class="texto">&nbsp;</TD> </TR> <tr bgcolor="#FFFFFF"> <TD width="100" height="10" ALIGN="LEFT" VALIGN="middle" class="texto">&nbsp;</TD> <TD width="198" ALIGN="center" VALIGN="middle" class="linkclaro"> <% 'Exibe um link para abrir o arquvo no Excel link="<a href=" &"/ascom/"& fileExcel & " class=""linkclaro"">Abrir o arquivo no Excel</a>" Response.write link%> </TD> <TD width="197" ALIGN="center" VALIGN="middle" class="texto">Voltar</TD> <TD width="100" ALIGN="LEFT" VALIGN="middle" class="texto">&nbsp;</TD> </TR> </TABLE></td> </tr> <tr> <td height="5" valign="middle" class="texto"><img src="fotos/imagens/5px.gif" width="10" height="5"></td> </tr> </table> </td> </tr> </table> <p>&nbsp;</p> <p>&nbsp;</p> </body> </html> O que acha q devo fazer???
  17. marcelolima

    Status Bar...

    galera.. é o seguinte... tem uma funcionalidade de nossa intranet para fazer um documento excel que vai servir de base de dados para mala direta. Mas acontece, que há muitos registros (mais de 7000)... e às vezes o usuário pode ter a falsa impressão que o script não tá sendo executado. vocês conhecem algum script que mostra ou o percentual que foi concluído ou uma barra de status com a mesma finalidade??? Abraços e vlw
  18. ValorContrato = Request.Form("ValorContrato") ValorContrato = replace((ValorContrato), ".", ";") ValorContrato = replace((ValorContrato), ",", ".") ValorContrato = replace((ValorContrato), ";", ",") Ae galera... valeu... obrigadãoo...
  19. você tem um exemplo aí? precisa de uma estrutura de repetição?
  20. Bom dia gente... vocês conhecem uma função que permita fazer a troca de valores??? 1.500,00 -> 1,500.00 Precisamos gravar num BD q está em ORACLE... daí na página anterior, que chama a página que guarda na base de dados, tem uma máscara que faz automaticamente colocar os pontos e vírgulas. Mas na hora de levar pro banco, tem que mudar... trocar ponto e vírgula... Alguém pode me ajudar?
  21. andreia_sp... aproveitando a deixa, você conhece algum script para orientar o papel de impressão para paisagem automaticamente?
  22. brother esquece o que eu falei acima... fiz um teste... e o campo que eu coloquei pra bloquear letras e colocar os pontos e as vírgulas... quando passa para a outra página e eu dou um Request.querystring("ValorContrato"), ele não imprime nada ou seja, não tá passando valor nenhum pra lá... entende?? eu estou digitando.. por exemplo, 100000... daí ele separa certinho 1.000,00, mas quando ele joga esse valor pra outra página... parece que o campo não tem valor algum! vlw!
  23. outra coisa.. o bloqueio de campo... tá funcionando... ou seja, só digitando número
×
×
  • Criar Novo...