- Fórum WMO
- → ibreak's Content
ibreak's Content
There have been 56 items by ibreak (Search limited from 29/04/2023)
#729763 Erro No Formulário De Indicação.
Posted by ibreak on 10/04/2006, 23:56 in ASP
Muitíssimo obrigado pela força.
Gostaria só de te pedir mais uma ajuda...
Na parte que o usuário recebe o link...
essa:
TXT = TXT & "<a href=http://"&Request.ServerVariables("HTTP_HOST")&"/tvonline/ver_video.asp?id="&Request.querystring("id")&">Clique Aqui</a>"
Como eu mando o link para ser aberto numa popup de 232 de largura por 266 de altura...
No caso atual o usuário recebe o link e é carregado as info na página inteira. Eu preciso que seja exibido da página apenas os 232 de largura e os 266 de altura. O que posso fazer para que quando o usuário clicar no link que ele recebe abrir uma popup ou abrir a página com tamanho fixo.
Valeu pela força.
#729413 Erro No Formulário De Indicação.
Posted by ibreak on 10/04/2006, 10:29 in ASP
Bem eu vi se imprimi o valor na janéla ver vídeo e imprimi sim... também fiz o mesmo na janéla de indicação e lá ele não imprimi... aparece em branco... isso quer dizer que a ID não está sendo enviada...
O comando que envia a ID quando eu clico no botão para indicar é este:
<iframe src="indicar.asp?ID_Video=<%=Request.querystring("id")%>" frameborder="0" scrolling="no" width="100%" height="270" name="indicar" marginwidth="1" marginheight="0"></iframe>
O que posso usar para a querystring enviar a ID?
#729331 Erro Quando Obtenho Informações Usando Session
Posted by ibreak on 10/04/2006, 00:46 in ASP
Bem tenho as seguintes dúvidas...
Tipo no primeiro campo eu usei do jeito que você indicou no seu post do link... veja:
<select name="tipo">
<% while NOT rsTipos.EOF %>
<option value="<%=rsTipos("codtipo")%>"><%=rsTipos("tipo")%></option>
<%
rsTipos.movenext
wend
%>
</select>
Já os demais campos estão assim...
<textarea name="chamada" cols="40" id="chamada"></textarea>
Eu tb tenho que mudar eles para assim:
<selected name = "chamada">
<textarea cols="40" id="chamada"></textarea>
e quando eu clicar no botão para enviar a foto ele mandará todos os dados correto para a outra página...
O comando está assim... <input type=button value="Cadastrar" onclick="document.form1.action='upload_form2.asp?tipo='+document.form1.tipo.value;document.form1.submit()">
Como e de que forma eu separo para enviar mais de um campo do formulário... pode me orientar...
Valeu por toda força.
#729245 Erro Quando Obtenho Informações Usando Session
Posted by ibreak on 09/04/2006, 17:14 in ASP
Eu faço o envio do formulário assim:
<form name="form1" action="upload_form2.asp" method="post" enctype="multipart/form-data">
Eu envio as info que são capturadas usando session...
O erro que está aparecendo é este:
Tipo de erro:
Objeto Request, ASP 0207 (0x80004005)
Não é possível usar a coleção Request.Form após chamar BinaryRead.
/news1/arquivos/adm/upload_form2.asp, line 10
Na linha 10 eu tenho isso:
SESSION ("titulo") = Request.form("titulo")
Qual pode ser o erro...
Veja abaixo código completo da página que dá o erro...
<!-- #include file = "upload_funcoes.asp" --> <% ' Chamando Funções, que fazem o Upload funcionar byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin ' Recuperando os Dados Digitados ---------------------- SESSION ("titulo") = Request.form("titulo") SESSION ("tipo") = Request.form("tipo") SESSION ("chamada") = Request.form("chamada") SESSION ("conteudo") = Request.form("conteudo") SESSION ("expira") = Request.form("expira") data=day(now)&"/"&month(now)&"/"&year(now) SESSION ("destaque") = Request.form("destaque") ' Tipo de arquivo que esta sendo enviado tipo_foto = UploadRequest.Item("foto").Item("ContentType") ' Caminho completo dos arquivos enviados caminho_foto = UploadRequest.Item("foto").Item("FileName") ' Nome dos arquivos enviados nome_foto = Right(caminho_foto,Len(caminho_foto)-InstrRev(caminho_foto,"\")) ' Conteudo binario dos arquivos enviados foto = UploadRequest.Item("foto").Item("Value") ' pasta onde as imagens serao guardadas pasta = Server.MapPath("imagens/") nome_foto = "/"&nome_foto ' pasta + nome dos arquivos cfoto = "imagens/noticia" + nome_foto ' Fazendo o Upload do arquivo selecionado if foto <> "" then Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject") Set MyFile = ScriptObject.CreateTextFile(pasta & nome_foto) For i = 1 to LenB(foto) MyFile.Write chr(AscB(MidB(foto,i,1))) Next MyFile.Close end if ' Conecta-se ao Banco de Dados url_conexao = Server.MapPath("../bd/base.mdb") set conexao = Server.CreateObject("ADODB.Connection") conexao.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&url_conexao 'Faremos aqui a inserção de todos os dados digitados no form anterior meubd.EXECUTE "INSERT INTO noticias (titulo, chamada, tipo, conteudo, expirar, data, destaque, foto) values ('"&titulo&"','"&chamada&"',"&tipo&",'"&conteudo&"','"&expira&"','"&data&"',"&destaque&"','"&cfoto&")" ' Mostra Mensagem de Confirmação na Tela Response.write "Dados Cadastrados com Sucesso!" 'Logo após a inserção dos dados, mostrará uma mensagem e voltará para a página principal.asp response.write "<script>location = 'principal.asp';alert('Sua notícia foi cadastrada com sucesso!')</script>" %>
#729224 Erro No Formulário De Indicação.
Posted by ibreak on 09/04/2006, 16:24 in ASP
Bem prometo seguir as suas dicas.
Achei bem legal a edição que você fez com o código... Tá muito legal...
Obrigado mesmo...
To estudando ASP até pra entender melhor muitas das dicas e scripts que o pessoal posta no Fórum...
Bem ficou bem legal e parou o erro de script, mas ainda continua o problema da ID em branco.
Generation eu já olhei em toda a página, desde a que envia até essa que recebe mas não consigo entender porque não captura a ID.
Vou postar aqui para que assim que tiver tempo... analise pra mim se é algo errado no envio da ID... eu olhei, fiz comprações com outras páginas mas não entendo o porque. Como te disse o link para clicar no botão de indicação mostra o envio da ID...
Código da página que faz envio da ID para indicação.
<%url="login"%> <!--#include file = "config.asp" --> <%Set id=Request.querystring("id")%> <html> <head> <title>Player</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #000000; } --> </style> <script language=JavaScript> <!-- //Disable right click script III- By Renigade (renigade@mediaone.net) //For full source code, visit http://www.dynamicdrive.com var message=""; function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false") --> </script> <script language=JavaScript> var status; status = 0 function onPause() { if (navigator.appName.indexOf('Netscape') != -1) estado=document.MediaPlayer1.GetPlayState(); else estado=document.MediaPlayer1.PlayState; if(estado==1) document.MediaPlayer1.Play(); else if (estado==2) document.MediaPlayer1.Pause(); } function onVolumeUp() { if (MediaPlayer1.Volume <= -300) { MediaPlayer1.Volume = MediaPlayer1.Volume + 300; } } function onVolumeDown() { if (MediaPlayer1.Volume >= -8000) { MediaPlayer1.Volume = MediaPlayer1.Volume - 300; } } </script> </head> <body> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- SISTEMA DE TV ON-LINE Criador: Bruno Pacola ICQ: 112104828 E-mail/MSN: brunopacola@hotmail.com Licença: Shareware Data de criação: 17-02-2004 - Cuiabá-MT/Brasil --> <head> <title>Player</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #000000; } --> </style> <script language=JavaScript> <!-- //Disable right click script III- By Renigade (renigade@mediaone.net) //For full source code, visit http://www.dynamicdrive.com var message=""; function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false") --> </script> <script language=JavaScript> var status; status = 0 function Redirecionar() { if (status == 1){ window.resizeTo(243,300); status = 0 } else { window.resizeTo(600,329); status = 1 } } function onPause() { if (navigator.appName.indexOf('Netscape') != -1) estado=document.MediaPlayer1.GetPlayState(); else estado=document.MediaPlayer1.PlayState; if(estado==1) document.MediaPlayer1.Play(); else if (estado==2) document.MediaPlayer1.Pause(); } function onVolumeUp() { if (MediaPlayer1.Volume <= -300) { MediaPlayer1.Volume = MediaPlayer1.Volume + 300; } } function onVolumeDown() { if (MediaPlayer1.Volume >= -8000) { MediaPlayer1.Volume = MediaPlayer1.Volume - 300; } } </script> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="600"> <!-- fwtable fwsrc="Untitled" fwbase="pac.jpg" fwstyle="Dreamweaver" fwdocid = "484919907" fwnested="0" --> <tr> <td><img src="images/spacer.gif" width="14" height="1" border="0" alt=""></td> <td><img src="images/spacer.gif" width="205" height="1" border="0" alt=""></td> <td><img src="images/spacer.gif" width="16" height="1" border="0" alt=""></td> <td><img src="images/spacer.gif" width="365" height="1" border="0" alt=""></td> <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td colspan="3"><img name="pac_r1_c1" src="images/pac_r1_c1.jpg" width="235" height="8" border="0" alt=""></td> <td rowspan="6" background="images/pac_r1_c4.jpg"><div align="center"> [color=#FF0000]<iframe src="indicar.asp?ID_Video=<%=Request.querystring("id")%>" [/color] frameborder="0" scrolling="no" width="100%" height="270" name="indicar" marginwidth="1" marginheight="0"></iframe> </div></td> <td><img src="images/spacer.gif" width="1" height="8" border="0" alt=""></td> </tr> <tr> <td rowspan="2"><img name="pac_r2_c1" src="images/pac_r2_c1.jpg" width="14" height="189" border="0" alt=""></td> <td background="images/pac_r2_c2.jpg"> <object id="MediaPlayer1" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject" width="205" height="180"> <param name="FileName" value="arquivo.asp?ID=<%=id%>"> <param name="ShowDisplay" value="FALSE"> <param name="ShowStatusBar" value="TRUE"> <param name="StatusBar" value="True"> <param name="AnimationAtStart" value="True"> <param name="ShowAudioControls" value="True"> <param name="ShowPositionControls" value="true"> <param name="ShowControls" value="False"> <param name="AutoSize" value="False"> <param name="AutoStart" value="TRUE"> <param name="AutoRewind" value="TRUE"> <embed width="205" height="180" filename="arquivo.asp?ID=<%=id%>" showdisplay="FALSE" showstatusbar="TRUE" statusbar="True" animationatstart="True" showaudiocontrols="True" showpositioncontrols="False" showcontrols="False" autosize="False" autostart="TRUE" autorewind="TRUE" src="arquivo.asp?ID=<%=id%>"></embed> </object> </td> <td rowspan="2"><img name="pac_r2_c3" src="images/pac_r2_c3.jpg" width="16" height="189" border="0" alt=""></td> <td><img src="images/spacer.gif" width="1" height="180" border="0" alt=""></td> </tr> <tr> <td><img name="pac_r3_c2" src="images/pac_r3_c2.jpg" width="205" height="9" border="0" alt=""></td> <td><img src="images/spacer.gif" width="1" height="9" border="0" alt=""></td> </tr> <tr> <td colspan="3"><img src="images/pac_r4_c1.jpg" alt="" name="pac_r4_c1" width="235" height="39" border="0" usemap="#pac_r4_c1Map"></td> <td><img src="images/spacer.gif" width="1" height="39" border="0" alt=""></td> </tr> <tr> <td colspan="3"><img src="images/pac_r5_c1.jpg" alt="" name="pac_r5_c1" width="235" height="29" border="0" usemap="#pac_r5_c1Map"></td> <td><img src="images/spacer.gif" width="1" height="29" border="0" alt=""></td> </tr> <tr> <td colspan="3"><img name="pac_r6_c1" src="images/pac_r6_c1.jpg" width="235" height="35" border="0" alt=""></td> <td><img src="images/spacer.gif" width="1" height="35" border="0" alt=""></td> </tr> </table> <map name="pac_r4_c1Map"> <area shape="rect" coords="161,6,187,23" href="#" alt="Baixar Volume" onClick="onVolumeDown();"> <area shape="rect" coords="132,6,158,23" href="#" alt="Aumentar Volume" onClick="onVolumeUp();"> <area shape="rect" coords="103,6,129,23" href="#" alt="Pausa" onClick="onPause();"> <area shape="rect" coords="74,6,100,23" href="#" alt="Stop" onClick="document.MediaPlayer1.Stop()"> <area shape="rect" coords="45,6,71,23" href="#" alt="Play" onClick="document.MediaPlayer1.Play()"> </map> <map name="pac_r5_c1Map"> <area shape="rect" coords="69,9,172,22" href="#" onClick="Redirecionar();"> </map> </body> </html> <body> <p align="center"> </p> </body> </html>
#729197 Erro No Formulário De Indicação.
Posted by ibreak on 09/04/2006, 13:16 in ASP
jmail.AppendHTML ("Nome: "&Request.form("seu_nome")&"<br>E-mail: "&Request.form("seu_email")&"<br><br>"&Request.form("seu_email")&"<br>
<br><br>Para ver o vídeo clique no link abaixo ou copie para o navegador:<br><a onclick=""popup('http://"&Request.ServerVariables("HTTP_HOST")&"/tvonline/ver_video.asp?id="&Request.querystring("ID_Video")&"','
Player','width=235,height=220')"" href""#"">http://"&Request.ServerVariables("HTTP_HOST")&"/tvonline/ver_video.asp?id="&Request.querystring("ID_Video")&"</a>")
Aind anão recebi...
Eu notei que quando recebo o e-mail e abro no Incredimail ela fala que a mensagem contém erros no script... acha que pode ter álguma coisa haver?
#729095 Erro No Formulário De Indicação.
Posted by ibreak on 09/04/2006, 00:10 in ASP
<iframe src="indicar.asp?ID_Video=<%=Request.querystring("id")%>" frameborder="0" scrolling="no" width="100%" height="100%" name="indicar" marginwidth="1" marginheight="0"></iframe>
quando eu coloco o cursor do mouse em cima do botão que abre o formulário de indicação, aparece assim:
http://www.aldo.noticiaregional.com.br/tvonline/ver_video.asp?id=1#
No formulário de indicação ele recebe nesta linha:
jmail.AppendHTML ("Nome: "&Request.form("seu_nome")&"<br>E-mail: "&Request.form("seu_email")&"<br><br>"&Request.form("seu_email")&"<br><br><br>Para ver o vídeo clique no link abaixo ou copie para o navegador:<br><a onclick=""popup('http://"&Request.ServerVariables("HTTP_HOST")&"/tvonline/ver_video.asp?id="&Request.querystring("id")&"','Player','width=235,height=220')"" href""#"">http://"&Request.ServerVariables("HTTP_HOST")&"/tvonline/ver_video.asp?id="&Request.querystring("id")&"</a>")
Vale lembrar que no formulário que ele envia estou recebendo assim o link: (não está linkado, apenas aparece como endereço sem a ID no final)
http://www.aldo.noti...r_video.asp?id=
o que pode ser...
#728995 Ajuda Para Montar Código... Sistema De Upload Pronto
Posted by ibreak on 08/04/2006, 18:23 in Dúvidas sobre Scripts Prontos de ASP
To aqui mais uma vez para pedir a ajuda dos profissionais que compreendem legal o ASP...
É o seguinte neste link abaixo eu disponibilizei um upload sem componente que eu baixei na net muito recomendado por não apresentar nenhuma falha ou dificuldade. Eu testei ele aqui e ele tá bem legal. Eu montei as páginas e o DB. Tá tudo no zip pra quem precisar desse upload sem componente. Segundo os sites que eu vi ele, ele é um dos melhores sistemas de upload sem componente.
Upload SEM Componente em ZIP (Envio de foto com DB)
Bem a ajuda que eu preciso é a seguinte...
Eu gostaria de utilizar este sistema de upload no zip nesta página... tipo no meu caso eu não preciso do DB que está no ZIP nem do formulário1, eu só preciso da mesma função de envio mas nessas mesmas estruturas como está o código abaixo. Eu não entendo legal de ASP, então não sei de que forma possa impregar o upload do ZIP nessa página...
Podem me ajudar?
<script language="JavaScript"> function video(URL) { opener.document.video.selurl.value=URL; self.close(); } </script> <link rel=stylesheet href="images/styles.css" type="text/css"> <form method="POST" enctype="multipart/form-data" name="enviarfoto"> <p><input type="file" name="File1" size="20"><br> <input type="submit" value="Enviar" name="action"></p> </form> <!---#INCLUDE FILE="upload.inc" ---> <% Dim Obj,objpasta, num, pasta pasta = Request.querystring("pasta") Local = server.mappath("videos/") Set Obj = Server.CreateObject("Scripting.FileSystemObject") Set objpasta = Obj.GetFolder(Local) num = objpasta.files.count If Request.ServerVariables("REQUEST_METHOD") = "POST" Then Set Fields = GetUpload() FilePath = server.mappath("videos/video_" &num& Right(Fields("File1").FileName,4)) arquivo="video_"&num&Right(Fields("File1").FileName,4) Fields("File1").Value.SaveAs FilePath If Right(arquivo,3)="avi" OR Right(arquivo,3)="mpeg" OR Right(arquivo,3)="mpg" OR Right(arquivo,3)="wmv" then %> <META HTTP-EQUIV="refresh" CONTENT="0; URL=java script:%20video('videos/<%=arquivo%>');"> <% else Set objFS = Server.CreateObject("Scripting.FileSystemObject") objFS.DeleteFile(Server.MapPath("videos/"&arquivo)) Set objFS = Nothing %> <script language="JavaScript"> { opener.document.video.selurl.value='Este formato não é válido'; self.close(); } </script> <% end if Set objFS = Nothing %><% end if %>
#728990 Erro No Formulário De Indicação.
Posted by ibreak on 08/04/2006, 17:58 in ASP
jmail.AppendHTML ("Nome: "&Request.form("seu_nome")&"<br>E-mail: "&Request.form("seu_email")&"<br><br>"&Request.form("seu_email")&"<br>
<br><br>Para ver o vídeo clique no link abaixo ou copie para o navegador:<br><a onclick=""popup('http://www."...les("HTTP_HOST")&"/ver_video.asp?id="&Request.querystring("ID_Video")&"','Player',
'width=232,height=266')"" href""#"">http://www."...les("HTTP_HOST")&"/ver_video.asp?id="&Request.querystring("ID_Video")&"</a>")
Como te disse ele tá mandando um www a mais e tb não tá enviando a ID linkado...
Se puder ajudar fico grato.
#728966 Erro No Formulário De Indicação.
Posted by ibreak on 08/04/2006, 16:36 in ASP
Preciso mais uma vez da ajuda de todos vocês. Tenho o seguinte problema.
Tenho um formulário de indicação que apresenta dois problemas.
O primeiro é que se eu preencho o e-mail, nome ou não, ele faz o envio do mesmo jeito. Precisa haver uma obrigação para preencher todos os dados e também verificar se o endereço de e-mail é válido. Eu inseri esses scripts no meu sistema, mas não sei porque eles não funcionam e não verificam se foi ou não preenchidos os campos e se estão corretos.
O outro problema é que a indicação está chegando no e-mail indica de forma errada.
Eu recebo o link desta forma:
http://www.www.aldo.noticiaregional.com.br/ver_video.asp?id=
Ele aumenta mais um www e não acrescenta no final a ID da notícia em vídeo, fazendo então o link para a página.
Como posso resolver este problema?
Obrigado.
Paulo
#728847 Erro No Envio De Newsletter, Componente?
Posted by ibreak on 08/04/2006, 01:40 in ASP
quanto a estas duas linhas...
Mail.BodyFormat=0
Mail.MailFormat=0
elas não funcionam no código do jeito que estão... dão este erro:
A Mensagem foi adicionado no historico com sucesso !
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'BodyFormat'
/boletim/enviar.asp, line 47
Como posso passar apenas estas duas linhas para funcionarem junto do CDOSYS
#728818 Erro No Envio De Newsletter, Componente?
Posted by ibreak on 07/04/2006, 22:14 in ASP
Estava assim: objCDOSYSMail.to = Session("email")
Eu coloquei assim: objCDOSYSMail.to=rs_sendmail("email")
Agora está funcionando...
Eu removi essas duas linhas do código como te disse acima que estavam dando erros... isso vai gerar álgum problema. Para que serve esses comandos:
Mail.BodyFormat=0
Mail.MailFormat=0
Mais uma dúvida final. Eu estava com um problema que dizia que não encontrava o include, o caminho estava assim: <!-- #include virtual="include/adovbs.inc" --> e eu mudei para isso e resolveu. <!-- #include file="include/adovbs.inc" -->
É só um outro processo de inserir include ou faz álguma diferença na include. É uma curiosidade.
Muito obrigado.
#728740 Erro No Envio De Newsletter, Componente?
Posted by ibreak on 07/04/2006, 18:23 in ASP
Estou com álgumas dificuldades sobre a transferência de CDonts Para CDOSYS.
Bem está aparecendo este erro:
A Mensagem foi adicionado no historico com sucesso !
CDO.Message.1 error '8004020c'
At least one recipient is required, but none were found.
/boletim/enviar.asp, line 50
Na linha 50 eu tenho isso (em vermelho)
set objCDOSYSMail = Server.CreateObject("CDO.Message")
set objCDOSYSCon = Server.CreateObject("CDO.Configuration")
objCDOSYSCon.Fields("http://schemas.micro...tion/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.micro...ion/smtpserver") = "mail.aldo.noticiaregional.com.br"
objCDOSYSCon.Fields("http://schemas.micro...smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.micro...nectiontimeout") = 60
objCDOSYSCon.Fields.update
set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = emailadministrador
objCDOSYSMail.to = Session("email")
objCDOSYSMail.Subject = Assunto
'objCDOSYSMail.BodyFormat=0
'objCDOSYSMail.MailFormat=0
objCDOSYSMail.htmlBody = Mensagem & "<BR><BR><font face=arial size=2><a href=""" & Msg_Cancelamento & "/deletar.asp?modo=Email&id=" & rs_sendmail("id") & "&Serial=" & rs_sendmail("SerialNumber") & """>Para remover seu e-mail desta lista CLIQUE AQUI!</a></font>"
objCDOSYSMail.Send
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
Deu também estes erros nas duas linhas acima, 'objCDOSYSMail.BodyFormat=0 / 'objCDOSYSMail.MailFormat=0, e eu comentei... o erro que deu foi este.
A Mensagem foi adicionado no historico com sucesso !
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'BodyFormat'
/boletim/enviar.asp, line 47
Podem me ajudar a resolver o problema do newsletter. Obrigado.
Vejam código completo da página.
<!-- #include file="Config.asp"--> <!-- #include file="abrirconexao.asp"--> <!--#INCLUDE file="topogeral.inc" --> <% '------------------------------------------------------------- '------------------------------------------------------------- Response.write "<div align=""center"">" Function Plic(strTexto) Temp = Replace(strTexto, "'", "''") Plic = Replace(Temp, """", """") End Function Assunto = Request("Assunto") Mensagem = Request("Mensagem") Data = Date() sSQL="SELECT * FROM Masters" Set rs=ConnStr.Execute(sSQL) emailadministrador=rs("email") Set rs=Nothing sql_select = "select * from Lista" no = 0 Set rs_sendmail = Server.CreateObject("ADODB.Recordset") rs_sendmail.Open sql_select, ConnStr if rs_sendmail.EOF then Response.write "<br><br><center><font face=arial size=2>" & Msg_NenhumEmail & "</font></center>" Else strSQL = "INSERT INTO HistoricoLista (Assunto, Mensagem, Data) VALUES ('" & Assunto & "', '" & Plic(Mensagem) & "', '" & Data & "')" ConnStr.Execute(strSQL) Response.write "<br><br><font face=arial size=""2"">" & Msg_HistoricoAdicionado & "</font><br>" While Not rs_sendmail.EOF set objCDOSYSMail = Server.CreateObject("CDO.Message") set objCDOSYSCon = Server.CreateObject("CDO.Configuration") objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.aldo.noticiaregional.com.br" objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 objCDOSYSCon.Fields.update set objCDOSYSMail.Configuration = objCDOSYSCon objCDOSYSMail.From = emailadministrador objCDOSYSMail.to = Session("email") objCDOSYSMail.Subject = Assunto objCDOSYSMail.BodyFormat=0 objCDOSYSMail.MailFormat=0 objCDOSYSMail.htmlBody = Mensagem & "<BR><BR><font face=arial size=2><a href=""" & Msg_Cancelamento & "/deletar.asp?modo=Email&id=" & rs_sendmail("id") & "&Serial=" & rs_sendmail("SerialNumber") & """>Para remover seu e-mail desta lista CLIQUE AQUI!</a></font>" objCDOSYSMail.Send Set objCDOSYSMail = Nothing Set objCDOSYSCon = Nothing no = no + 1 rs_sendmail.MoveNext Wend Response.Write "<br><font face=arial size=2>Total de Emails enviado: " & no & " email(s).</font>" rs_sendmail.Close Set rs_sendmail = Nothing End If Response.write "</div>" %> <!-- #include file="undergeral.inc"--> <!-- #include file="fecharconexao.asp"-->
#728605 Erro No Envio De Newsletter, Componente?
Posted by ibreak on 07/04/2006, 14:15 in ASP
A Mensagem foi adicionado no historico com sucesso !
Microsoft VBScript runtime error '800a0046'
Permission denied
/boletim/enviar.asp, line 42
Na linha 42 eu tenho isso aqui: (em vermelho)
While Not rs_sendmail.EOF
Set mail = Server.CreateObject("CDONTS.NewMail")
mail.From=emailadministrador
mail.To=rs_sendmail("email")
mail.Subject=Assunto
Mail.BodyFormat=0
Mail.MailFormat=0
mail.Body = Mensagem & "<BR><BR><font face=arial size=2><a href=""" & Msg_Cancelamento & "/deletar.asp?modo=Email&id=" & rs_sendmail("id") & "&Serial=" & rs_sendmail("SerialNumber") & """>Para remover seu e-mail desta lista CLIQUE AQUI!</a></font>"
mail.Send
Set mail = Nothing
no = no + 1
rs_sendmail.MoveNext
Wend
Response.Write "<br><font face=arial size=2>Total de Emails enviado: " & no & " email(s).</font>"
rs_sendmail.Close
Set rs_sendmail = Nothing
End If
O suporte do meu servidor de hospedagem disse que é porque não existe mais o CDonts e sim CDosys, acho que é isso... Caso seja isso, alguém poderia me ajudar a mudar o componente para que o newsletter funcione...
Obrigado...
#727817 Inserir Campo Para O Envio De Foto
Posted by ibreak on 05/04/2006, 15:57 in ASP
Tenho álgumas duvidas e gostaria de que me ajudasse se possível...
A primeira delas é sobre a melhor forma de enviar a foto. Eu tenho um formulário já na página que pega o título a data e o texto e envia para o DB. Eu inclui nessa página um outro formulário que vai pegar a foto e vai ter o botão upload que vai mandar a foto para o servidor. Irá abrir um janéla popup dizendo que a foto foi enviada com sucesso.
Essa forma que eu criei é funcional e é uma forma legal de mandar as fotos?
Depois de mandar a foto, ficará o nome da foto no campo foto. Como eu configuro o outro formulário o que vai mandar a notícia para pegar o nome da foto e enviar para o DB. Veja o código abaixo como está o envio dos campos do dormulário. Minha dúvida é como falar pro formulário da notícia também pegar o que está escrito na caixa de texto da foto que foi enviada. Quando eu envio a foto o sistema deixa o nome da foto apenas...
Meu servidor suporta sim o Dundas...
<%if session("logado")="" then response.Redirect("login.asp") response.end end if%> <html> <head> <title>Documento sem título</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <p><font size="5">Nova noticia</font></p> <script language="JavaScript"> function abrir(URL) { var width = 400; var height = 200; var left = 99; var top = 99; window.open(URL,'Foto', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no'); } </script> <table width="390" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="390"><form method="POST" enctype="multipart/form-data" action="java script:abrir('http://localhost/news/upload.asp');"> <input type="FILE" size="40" name="FOTO"><br> </form></td> </tr> <tr> <td><input name="submit" type=submit value="Upload!"></td> </tr> </table> <form name="form6" method="post" action="novaok.asp"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><strong>Data:</strong></td> <td> <input name="data" type="text" id="data" value="<%=date%>" readonly> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td><strong>Título</strong></td> <td> <input name="titulo" type="text" id="titulo"> </td> </tr> <tr> <td><strong>Notícia</strong></td> <td> <textarea name="noticia" cols="50" rows="10" id="noticia"></textarea> </td> </tr> <tr> <td> <input type="submit" name="Submit" value="Enviar"> </td> <td> <input type="reset" name="Submit2" value="Limpar"> </td> </tr> </table> </form> <p><font size="5"></font> </p> </body> </html>
#727760 Inserir Campo Para O Envio De Foto
Posted by ibreak on 05/04/2006, 13:21 in ASP
Eu gostaria de criar nesse sistema uma opção para o envio de foto. Ele não tem esse sistema.
Sou iniciante em ASP então qualquer dica é sempre bem vinda.
Eu tenho um sistema de news em asp aonde vc cadastra a notícia e depois abre uma tela para o envio da foto para o ID da notícia que vc cadastrou anteriormente, mas acho complicado isso, até porque depois pra editar a foto como a notícia acaba sendo bem mais complicado.
Eu gostaria de saber qual a melhor forma de criar um campo para enviar a foto, e aonde ele deve ficar, tipo junto na hora que vc cadastra a notícia, ou depoisnde cadastrada, o que é melhor...
Existem técnicas em ASP para reduzir o tamanho da foto ou limitar o tamanho para que o usuário não envie um afoto gigantesca...
E o componente de envio. É melhor sem componente.
Se alguém tiver algums script ou informações detalhadas de como fazer isso agradeço de coração.
Muito obrigado.
#725561 Como Criar Opção Para Editar A Notícia.
Posted by ibreak on 30/03/2006, 16:17 in ASP
É o seguinte a´página abaixo exibe as notícias cadastradas no meu DB, e nessa tela eu posso também selecionar as notícias que eu quero deletar. Seleciono a caixa de seleção e clico no botão para excluir notícia selecionada.
Eu quero criar uma opção como essa de escluir, só que uma opção para editar as notícias. Tipo pra cada notícia que o sistema exibir ele deverá mostrar tb uma opção para editar a notícia.
Nesse mesmo sistema eu tenho uma tela, submit que cadastra a notícia e depois de cadastrada abre outra para enviar a foto. Neste caso como eu poderia melhorar esse sistema. Tem como também editar a foto, ou seja, alterar o arquivo que estava na notícia sado eu deseje. Como posso fazer um botão editar para fazer essas alterações.
Abaixo publiquei o código da página que exibe todas a snotícias cadastradas e mais abaixo o código da página que é responsável para cadastrar as notícias...
<!--#include file="config.asp"--> <%Response.Buffer = True%> <!--#INCLUDE FILE="config.inc"--> <!--#INCLUDE FILE="level1.inc"--> <% '*********************************************************************** '** Sistema de Notícias desenvolvido pela TemisNet ** '** Contatos: Temístocles Sota - ICQ 104458476 ** '** http://www.temisnet.com.br ** '*********************************************************************** %> <html> <head> <title><%=TS%></title> <link rel="stylesheet" type="text/css" href="estilo.css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body bgcolor="#E0E0E0" text="#000000"> <form method="POST" action="admin2.asp?flag=1"> <% flag = request.querystring("flag") if flag = 1 then If IsEmpty(request.form("ID")) then %> <p align=center> <table width=450 border=1 align="center" cellpadding=0 cellspacing=0 bordercolor=#CCCCCC bgcolor="#6699CC"> <tr><td width=415> <p align=center><font color="#FFFFFF" size="2" face="Verdana">Erro ao Excluir</font></p> </td></tr> <tr> <td width=415 bgcolor=#FFFFFF> <p align=center><font face=Verdana size=2>Para excluir uma ou mais notícias selecione a mesma.</font></p> </td></tr></table> <% End If set rs = nothing ID = request.form("ID") set conn = server.createobject("adodb.connection") conn.Open Dados For each record in request("ID") sqlstmt = "DELETE * from noticias WHERE ID="& record Set RS = conn.execute(sqlstmt) Next End If %> <br><div align="center"> <center> <table width="450" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#6699CC"> <tr> <td width="415"> <div align="center"><font color="#FFFFFF" size="2" face="Verdana">APAGUE AS NOTÍCIAS, ASSINALANDO E CLICK EM APAGAR</font></div> </td> </tr> <% set rs = nothing sqlstmt = "SELECT * FROM noticias ORDER BY data, id ASC" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sqlstmt, Dados, 3, 3 TotalRecs = rs.recordcount x = 0 For x = 1 to 9999 If rs.eof then Exit For Else date1 = rs("data") id = rs("ID") name = rs("titulo") link = "<a href='view.asp?id=" & id & "'>" & date1 & "</a>" description = name %> <tr> <td width="415" bgcolor="#FFFFFF"> <input type="checkbox" name="ID" value="<% =id %>"> <font face="Verdana" size="2"> <% =link%> -- <% =description%> </font></td> </tr> <% rs.MoveNext End If Next%> </table> </center> </div> <p align="center"> <input type="submit" value="APAGAR" name="B1"> <br> <br> <font face="Verdana" size="2"><b> <a href="submit.asp">Enviar novas notícias</a></b></font></p> <table width="450" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#FFFFFF"><div align="center"> <% Response.Write "<p><font size=1 face= Verdana, Arial, Helvetica, sans-serif><a href=""utility.asp?method=abandon"">Sair</font></a>"%></div></td> </tr> </table> </form> </body> </html>
Página responsável pelo envio da notícia.
<!--#include file="config.asp"--> <%Response.Buffer = True%> <!--#INCLUDE FILE="config.inc"--> <!--#INCLUDE FILE="level1.inc"--> <% '*********************************************************************** '** Sistema de Notícias desenvolvido pela TemisNet ** '** Contatos: Temístocles Sota - ICQ 104458476 ** '** http://www.temisnet.com.br ** '*********************************************************************** %> <html> <head> <title><%=TS%></title> <link rel="stylesheet" type="text/css" href="estilo.css"> <style> input {border: 2 solid #000000} </style> <script language=Javascript> function preview1(){ if (form.titulo.value == ""){ div1.innerHTML = "<p align=center><br><br><br><br><b>É recomendado que você de um titulo a notícia!<br><br><input type='text' name='titulo2' value='' size='62' onchange=name1change()><br><br>Coloque acima o titulo para continuar!</b></p>"} else{ div1.innerHTML = "<B>"+ form.titulo.value + "--" + form.date1.value + "</b><br><br>" + form.conteudo.value} } function name1change(){ form.titulo.value = form.titulo2.value } </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><STYLE type="text/css"> <!-- BODY { scrollbar-face-color: FFFFFF; scrollbar-highlight-color: 6060FF; scrollbar-3dlight-color: 404080; scrollbar-darkshadow-color: 404080; scrollbar-shadow-color: 6060FF; scrollbar-arrow-color: 404080; scrollbar-track-color: FFFFFF; } --> </STYLE> </head> <body bgcolor="#E0E0E0" text="#000000"> <% inputnum = request.querystring("inputnum") If IsEmpty(inputnum) or inputnum = "" then %> <form id=form method="POST" action="submit.asp?inputnum=1"> <center> <table width="460" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999"> <tr> <td width="460" height="20" bgcolor="#CCCCCC"> <table width="440" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="106" height="20" bgcolor="#6699CC"> <div align="center"><b><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">INSERIR</font></b></div></td> <td width="334" bgcolor="#CCCCCC"> </td> </tr> </table> </td> </tr> <tr> <td align="right"> <div align="center"> <table width="460" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="460" align="left" bgcolor="#FFFFFF"> <div align="center"> <table width="460" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td width="0"> </td> <td width="0" height="19"> </td> <td width="0" height="19"> </td> <td width="0" height="19"> </td> </tr> <tr valign="top"> <td> </td> <td height="30"><strong>Região:</strong></td> <td height="30"> </td> <td height="30"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <select name="regiao" id="regiao"> <option value="1" selected>Rio Claro</option> <option value="2">Dracena</option> </select> </font></td> </tr> <tr valign="top"> <td width="10"> </td> <td width="51" height="30"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Categoria:</strong></font></td> <td width="9" height="30"> </td> <td width="368" height="30"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <select name="categoria" id="categoria"> <option value="1">Ciência</option> <option value="2">Compras</option> <option value="3">Cultura</option> <option value="4">Economia</option> <option value="5">Entretenimento</option> <option value="6">Especial</option> <option value="7">Esporte</option> <option value="8">Gente</option> <option value="9">Informática</option> <option value="10">Mega-Sena</option> <option value="11">Moda</option> <option value="12">Política</option> <option value="13">Segurança</option> <option value="14">Serviço</option> <option value="15">Tecnologia</option> <option value="16">Televisão</option> <option value="17">Tempo</option> <option value="18">Turismo</option> <option value="19">Vida e Saúde</option> <option value="20">Transportes</option> <option value="21">Notícias</option> <option value="22">JORI</option> </select> </font></td> </tr> <tr valign="top"> <td width="10"> </td> <td height="30"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Descrição:</strong></font></td> <td width="9" height="30"> </td> <td height="30"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="65" --> <input name="descricao" type="text" id="descricao2" value="" size="50" maxlength="65"> </font></td> </tr> <tr valign="top"> <td width="10"> </td> <td height="30"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Título:</b></font></td> <td width="9" height="30"> </td> <td height="30"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="titulo" value="" size="50"> </font></td> </tr> <tr valign="top"> <td width="10"> </td> <td height="150"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Notícia:</b></font></td> <td width="9" height="150"> </td> <td height="150" align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <textarea rows="8" name="conteudo" cols="55" style="border-style: solid; border-width: 2"> </textarea> </font></td> </tr> <tr> <td width="10"> </td> <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Data:</b></font></td> <td width="9"> </td> <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="date1" value="<%=Date%>" size="13"> <b> <a onClick="preview1()" name="prev" href="#prev">Clique aqui para visualizar a notícia.</a></b> </font></td> </tr> <tr> <td> </td> <td><strong>Hora:</strong></td> <td> </td> <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <input name='hora' type='text' id='hora' value='<%=Response.Write( hour(now()) & ":" & minute(now()) & ":" & second(now()))%>' size='15'> </font></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </div></td> </tr> </table> </div></td> </tr> </table> <div align="center"><br> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><br> </font> </div> <table width="462" height="243" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999"> <tr> <td width="124" height="21"> <table border="0" cellpadding="0" cellspacing="0" width="463" height="21"> <tr> <td width="106" bgcolor="#6699CC" height="20" align="center"> <div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FFFFFF">VISUALIZAR</font></b></font></div></td> <td width="319" bgcolor="#CCCCCC" height="21"> </td> </tr> </table> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF" width="451" height="222"> <div id="div1" style="width: 448px; height: 220px"> <div align="center"><font size=1 face= Verdana, Arial, Helvetica, sans-serif></div></td> </tr> </table> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><br> <input type="submit" value="ENVIAR NOTÍCIA PARA O SITE" name="B1" style="font-family: Arial; font-size: 8 pt"> </font> </center> </form> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <% else data = request.form("date1") If data = "" Then data = date() dia = DatePart("d", data) If dia < 10 Then dia = "0"&dia mes = DatePart("m", data) If mes < 10 Then mes = "0"&mes ano = DatePart("yyyy", data) data = dia & "/" & mes & "/" & ano tema = Replace(Replace(Request("tema"),Chr(13),"<br>"),"'","") Response.write tema & "<br>" categoria = Request("categoria") Response.write tema & "<br>" titulo = Replace(Replace(Request("titulo"),Chr(13),"<br>"),"'","") Response.write titulo & "<br>" descricao = Replace(Replace(Request("descricao"),Chr(13),"<br>"),"'","") Response.write descricao & "<br>" conteudo = Replace(Replace(Request("conteudo"),Chr(13),"<br>"),"'","") Response.write Conteudo & "<br>" hora = hour(time) & ":" & minute(time) & ":" & second(time) Set Conn = Server.CreateObject("adodb.connection") conn.Open Dados SQLstmt = "INSERT INTO noticias (regiao,categoria,descricao,titulo,data, hora,conteudo)" SQLstmt = SQLstmt & " VALUES (" SQLstmt = SQLstmt & regiao & "," SQLstmt = SQLstmt & categoria & "," SQLstmt = SQLstmt & "'" & descricao & "'," SQLstmt = SQLstmt & "'" & titulo & "'," SQLstmt = SQLstmt & "'" & data & "'," SQLstmt = SQLstmt & "'" & hora & "'," SQLstmt = SQLstmt & "'" & conteudo & "')" SQL = "SELECT * FROM noticias order by id desc" Set RS = conn.execute(SQLstmt) Set RS2 = conn.execute(SQL) response.redirect "submit2.asp?id="&RS2("id") end if %> </font> <table width="450" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#FFFFFF"><div align="center"> <% Response.Write "<p><font size=1 face= Verdana, Arial, Helvetica, sans-serif><a href=""utility.asp?method=abandon"">Sair</font></a>"%> </div></td> </tr> </table> </body>
#724696 Erro Na Nova Paginação
Posted by ibreak on 28/03/2006, 16:42 in ASP
MEU CÓDIGO ESTÁ ASSIM:
<%@ Language=VBScript %> <%Response.Expires = 0%> <%Response.Buffer = true%> <!--#include file="verify_login.asp"--> <!--#include file="header.asp"--> <% registros = 20 pagina = Request.QueryString("pagina") If pagina = "" Then pagina = 1 End If user = Session("member") set Conexao = Server.CreateObject ("ADODB.Connection") Conexao.Open Application("connString") Set rs = Server.Createobject("ADODB.RECORDSET") set rs.ActiveConnection = Conexao rs.CursorType = 3 rs.PageSize = registros sql = "SELECT * FROM User_logTime WHERE offline=True AND user_id=" & user & " ORDER BY id DESC" rs.Open sql If rs.EOF Then Response.Write "Nenhum registro encontrado" Response.Write "<p class=FieldLabel>Histórico do usúario: " & rs("FirstName") & " " & rs("LastName") & " (" & rs("UserName") & ")</p>" rs.Close rs.Open "SELECT DISTINCT user_id FROM User_LogTime WHERE offline=False", Application("connString"), 3 online = rs.RecordCount rs.Close set rs = nothing Response.Write "<table cellspacing=2 cellpadding=2 width=50% >" Response.Write "<tr bgcolor=#333366>" Response.Write "<td><font class=colltitle>Sessão N.º:</a></td>" Response.Write "<td><font class=colltitle>Data e Hora do Login:</a></td>" Response.Write "<td><font class=colltitle>Data e Hora do Logout:</a></td>" Response.Write "<td><font class=colltitle>IP:</a></td>" Response.Write "</tr>" & vbcrlf i = 1 while not rs.EOF if i mod 2 then Response.Write "<tr class=defaultsmall>" else Response.Write "<tr class=defaultsmall bgcolor=#dedede>" end if Response.Write "<td>" & rs("SID") & "</td>" Response.Write "<td>" & rs("Login_Time") & "</td>" if rs("Logout_Time") <> "" then Response.Write "<td>" & rs("Logout_Time") & "</td>" else Response.Write "<td>N/A</td>" end if Response.Write "<td>" & rs("user_ip") & "</td>" Response.Write "</tr>" & vbcrlf i = i + 1 rs.MoveNext wend rs.Close set rs = nothing Response.Write "</table>" Response.Write "<p class=defaultsmall>" & online & " usúario(s) online.</p>" else Response.Write "<p class=FieldLabel>Este é seu primeiro acesso ao sistema.<br> Você ainda não tem histórico, faça o logout e logue-se novamente.</p>" end if %> <a href='logout.asp' class=errmsg>Logout!</a> <% 'Else rs.AbsolutePage = pagina While Not rs.EOF AND x < rs.PageSize x = x + 1 %> <% rs.MoveNext Wend anterior = pagina - 1 proxima = pagina + 1 ultima = rs.PageCount primeira = 1 ultm2 = FormatNumber(rs.PageCount - 1,0) If pagina <> 1 Then Response.Write "<b>« <a href=home.asp?pagina="&primeira&">Primeira Página</a></b> " End If If pagina > 1 AND pagina <> 2 Then Response.Write "<b>[ <a href=home.asp?pagina="&anterior - 1&">"&anterior - 1&"</a> ]</b> " End If If pagina > 1 Then Response.Write "<b>[ <a href=home.asp?pagina="&anterior&">"&anterior&"</a> ]</b> " End If Response.Write "<b>[ "&pagina&" ]</b> " If Not rs.EOF Then Response.Write "<b>[ <a href=home.asp?pagina="&proxima&">"&proxima&"</a> ]</b> " End If If Not rs.EOF AND pagina <> ultima AND pagina <> ultm2 Then Response.Write "<b>[ <a href=home.asp?pagina="&proxima + 1&">"&proxima + 1&"</a> ]</b> " End If If Not rs.EOF Then Response.Write "<b><a href=home.asp?pagina="&ultima&">Última Página</a> »</b> " End If rs.Close Set rs = Nothing 'End If %>
#723386 Erro Na Nova Paginação
Posted by ibreak on 25/03/2006, 13:26 in ASP
Esse recordset chamado rs_log certamente veio do arquivo que eu me baseei para paginar. Estou quase certo que peguei ele da pagina de exemplo para fazer paginação.
De todas as vezes, desta o código executou quase que completo...
Veja o erro agora:
Este é seu primeiro acesso ao sistema.
Você ainda não tem histórico, faça o logout e logue-se novamente.
Logout!
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/login5/home.asp, line 76
Na linha 76 eu tenho isso aqui ó...
<b><%=rs("campo")%></b><br>
Eu não sei e não compreendi que campo é este que ele está consultando. Seria mais um campo errado?
Eu consultei o código do sistema (esta mesma página) sem paginação. O arquivo original, para tentar encontrar álguma referência a este campo, mas não localizei. Veja o code original.
<%@ Language=VBScript %> <%Response.Expires = 0%> <%Response.Buffer = true%> <!--#include file="verify_login.asp"--> <!--#include file="header.asp"--> <center> <% user = Session("member") set rs_log = server.CreateObject ("ADODB.Recordset") query = "SELECT * FROM User_logTime WHERE offline=True AND user_id=" & user & " ORDER BY id DESC" rs_log.Open query, Application("connString"), 3 if not rs_log.eof then set rs = server.CreateObject ("ADODB.Recordset") query = "SELECT * FROM Members WHERE id=" & user rs.Open query, Application("connString"), 3, 3 Response.Write "<p class=FieldLabel>Histórico do usúario: " & rs("FirstName") & " " & rs("LastName") & " (" & rs("UserName") & ")</p>" rs.Close rs.Open "SELECT DISTINCT user_id FROM User_LogTime WHERE offline=False", Application("connString"), 3 online = rs.RecordCount rs.Close set rs = nothing Response.Write "<table cellspacing=2 cellpadding=2 width=50% >" Response.Write "<tr bgcolor=#333366>" Response.Write "<td><font class=colltitle>Sessão N.º:</a></td>" Response.Write "<td><font class=colltitle>Data e Hora do Login:</a></td>" Response.Write "<td><font class=colltitle>Data e Hora do Logout:</a></td>" Response.Write "<td><font class=colltitle>IP:</a></td>" Response.Write "</tr>" & vbcrlf i = 1 while not rs_Log.EOF if i mod 2 then Response.Write "<tr class=defaultsmall>" else Response.Write "<tr class=defaultsmall bgcolor=#dedede>" end if Response.Write "<td>" & rs_Log("SID") & "</td>" Response.Write "<td>" & rs_Log("Login_Time") & "</td>" if rs_Log("Logout_Time") <> "" then Response.Write "<td>" & rs_Log("Logout_Time") & "</td>" else Response.Write "<td>N/A</td>" end if Response.Write "<td>" & rs_Log("user_ip") & "</td>" Response.Write "</tr>" & vbcrlf i = i + 1 rs_Log.MoveNext wend Response.Write "</table>" Response.Write "<p class=defaultsmall>" & online & " usúario(s) online.</p>" else Response.Write "<p class=FieldLabel>Este é seu primeiro acesso ao sistema.<br> Você ainda não tem histórico, faça o logout e logue-se novamente.</p>" end if rs_Log.Close set rs_Log = nothing %> <a href='logout.asp' class=errmsg>Logout!</a> </center>
#723186 Erro Na Nova Paginação
Posted by ibreak on 24/03/2006, 20:51 in ASP
Este é seu primeiro acesso ao sistema.
Você ainda não tem histórico, faça o logout e logue-se novamente.
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/login5/home.asp, line 68
Na linha 68 eu tenho isso:
end if
rs_Log.Close
set rs_Log = nothing
%>
Generation desculpe esses problemas... não tem quem me ajude a resolver... Obrigado pela sua colaboração e de todo o fórum...
A Conexão eu tirei de um global.asa que veio junto com o sistema de login... como o meu site já tem um global.asa eu então peguei e inseri a conexão do sistema de login dentro do meu global.asa do site...de onde voce tirou esse conexao ?
Acho que deve ficar assim:<%@ Language=VBScript %>
<%Response.Expires = 0%>
<%Response.Buffer = true%>
<!--#include file="verify_login.asp"-->
<!--#include file="header.asp"-->
<%
registros = 20
pagina = Request.QueryString("pagina")
If pagina = "" Then
pagina = 1
End If
user = Session("member")
set Conexao = Server.CreateObject ("ADODB.Connection")
Conexao.Open Application("connString")
Set rs = Server.Createobject("ADODB.RECORDSET")
set rs.ActiveConnection = Conexao
rs.CursorType = 3
rs.PageSize = registros
[]'s
Evite posts seguidos, use o botao editar
#723127 Erro Na Nova Paginação
Posted by ibreak on 24/03/2006, 17:48 in ASP
Veja o Global.asa
<script language="VBScript" runat="server"> 'Inicia as variaveis de aplicação Sub Application_onStart() ' - - - -Conexao com o banco de dados - -- - -- - -- --- - - - - -- Application("Connection") = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Domains\noticiaregional.com.br\db\noticias.mdb;" Application("connString") = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Domains\noticiaregional.com.br\db\acesso.mdb" End Sub Sub Session_OnEnd set conn = Server.CreateObject ("ADODB.Connection") conn.Open Application("connString") ' Update the record when the user logout and write the logout time plus it sets the user as OFFLINE. query = "UPDATE User_LogTime SET Logout_Time=#" & now() & "#, offline=True WHERE offline=False AND SID=" & Session.SessionID & " AND user_id=" & Session("member") conn.Execute (query) conn.Close set conn = Nothing End Sub Sub Session_onStart() Session.Timeout = 20 Session.LCID = 1046 End Sub </script>
- Fórum WMO
- → ibreak's Content
- Privacy Policy
- Regras ·