Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal como vai?Depois de converter um bd de access para mysql, estou com problemas na hora de me conectar. Segue abaixo o código do site. Onde estou errando? Me deem a dica aí namoral. :)<%Set Conn = Server.CreateObject("ADODB.Connection")Conn.Open "Driver={MySQL ODBC 3.51 Driver};Server=meusite.com;Database=bd_site;User=meulogin;Password=minhasenha;Option=3;"%>
é o seguinte: eu fiz um banco de dados no access e em seguida criei um bd em mysql pelo painel de controle do serviço de hospedagem (via web). Depois disso, converti o bd feito em access para mysql, e então tudo que tava no access (tabelas, colunas etc) foi pro bd do mysql lá do servidor do site. É tanto, que depois fui acessar o painel, e por lá mesmo vi o bd mysql todo convertido, como eu havia feito. A dúvida é:- meu conteúdo de sites *.asp está no servidor, e quero que esse site asp, conecte ao bd do mysql.Sacou? :)ps: sobre o erro, abaixo vai a descrição.------------------------------------------------Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, and inform them of the time the error occurred and anything you might have done that may have caused the error.More information about this error may be available in the server error log.--------------------------------------------------------------------------------Web Server at radioagitabrasil.com
é o seguinte: eu fiz um banco de dados no access e em seguida criei um bd em mysql pelo painel de controle do serviço de hospedagem (via web). Depois disso, converti o bd feito em access para mysql, e então tudo que tava no access (tabelas, colunas etc) foi pro bd do mysql lá do servidor do site. É tanto, que depois fui acessar o painel, e por lá mesmo vi o bd mysql todo convertido, como eu havia feito. A dúvida é:- meu conteúdo de sites *.asp está no servidor, e quero que esse site asp, conecte ao bd do mysql.Sacou? :)ps: sobre o erro, abaixo vai a descrição.------------------------------------------------Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, and inform them of the time the error occurred and anything you might have done that may have caused the error.More information about this error may be available in the server error log.--------------------------------------------------------------------------------Web Server at radioagitabrasil.com
ENTÃO ...você DEVE ESTAR USANDO PLESK NÉ?? Dá uma olhada no gerenciados de "LOGS" que lá aparece onde e que erro está dando;)abraços
opa como vai?!Rapz, acabei de ver aqui no sistema do PLESK o tal log que você disse....Tinha lá as datas, e então eu cliquei no aquivo com a data atual (no caso, 8/04/2007), só que apareceu uma tela cheia de nomes esquisitos, uma loucura danada...E agora?
opa como vai?!Rapz, acabei de ver aqui no sistema do PLESK o tal log que você disse....Tinha lá as datas, e então eu cliquei no aquivo com a data atual (no caso, 8/04/2007), só que apareceu uma tela cheia de nomes esquisitos, uma loucura danada...E agora?
ehehehe blza....esses são os "LOGS" que o servidor armazena,,,, você tem que pegar o horário que você tá executando a tal pagina com erro...e acompanhar pelo log....vai lendo a linha inteira que ele vai mostrar o erro do IIS....exemplo "Erro, statement..."...e por ai vai..mas sempre vai dando F5 pra atualiza os horarios e erros...se nao coseguir...dá um tok...é isso aiab´s;)
Diegao meu velho.... tentei aqui achar o bendito, mas n deu regue cara. E aí? Tem algum problema fazer a colagem do log aqui?
cara me passa seu msn é mais facil..ehehhehe
aí broder: djespanhol@hotmail.com
depois vcs postem a solução pra galera por favor...abrass
Maux por enquanto o problema ainda n foi resolvido.Tentei alguns conectores que o broder me deu a dica mas tá dando problemas.. n consigo conectar ao mysql.O engraçado é que quando vou no mysql front me conecto tranquilamente no bd remoto do servidor do site.....Por enquanto a coisa é um mistério..Por favor, quem souber mais ou menos o que tá rolando namoral mesmo dá um dica :)Acho que isso é caso pro CSI investigação criminal rsrsUm abraço
qual mensagem de erro aparece no browser?se não aparece os detalhes é porque está com as páginas amigaveis do plesk habilitadas. Deice como padrão as de erro 500, veja exatamente o erro e poste no forum pra gem ter uma ideia do que está acontecendo
Isso mesmo J. o sistema é plesk mesmo... aparece uma página de erro bem boba, que não mostra os detalhes e nem onde tá dando o bendito erro. Vou acessar aqui o painel de controle pra ver se mudo. Mas antes disso, pra mudar, clico onde?
xi cara.....não tem como eu acessar plesk aqui da empresa, mas procura algo por página de erros e desabilita as páginas personalizadas de todas que são erro 500, depois disso vai aparecer os detalhes do erro no browser
Pronto galera consegui colocar o "safado" do plesk pra exibir o erro com detalhes. O erro em questão é esse aí.
----------------------------------------------
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/todasnot.asp, line 74
-------------------------------------------
O código asp é:
----------------------------
<% Set db = server.createobject("adodb.connection")'data = "Driver={MySQL ODBC 3.51 Driver}; SERVER=mysql.w3.net2.com.br; DATABASE=vcszone; UID=vcszone; PWD=strike;" data = "Driver={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=meubanco; UID=meuid; PWD=minhasenha;" db.CursorLocation = 3db.open data%><html><head><title>Rádio AgitaBrasil</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><META content="Rádio AgitaBrasil - um site de notícias musicais, lançamentos, programas variados que tocam o melhor da música eletrônica, black music, rock, forró, axé music e muito mais."name=Description><META content="rádio, música eletrônica, rock, pop, pop rock, new metal, forró, djs, notícias do mundo da música, promoções" name=Keywords><META content=document name=resource-type><META content=Internet name=classification><META content=all name=robots><META content=General name=rating><META content="Rádio AgitaBrasil" name=Author><META NAME="author" CONTENT="Mateus Gomes"><META content=pt-br name=language><LINK href="arquivos/style.css" type=text/css rel=stylesheet><script src="noticias/arquivos/textsizer.js" type=text/javascript></SCRIPT><script language="JavaScript" type="text/JavaScript"><!--function abre01 (url) {window.open(url,'abre01','width=510,height=450,location=0,menubar=0,resizable=0,scrollbars=no,status=0,toolbar=0,left=250,top=50');}function abre02 (url) {window.open(url,'abre02','width=395,height=620,location=0,menubar=0,resizable=0,scrollbars=no,status=0,toolbar=0,left=330,top=20');}function abre03 (url) {window.open(url,'abre03','width=510,height=450,location=0,menubar=0,resizable=0,scrollbars=no,status=0,toolbar=0,left=250,top=50');}function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true);function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_callJS(jsStr) { //v2.0 return eval(jsStr)} //--></script></head><body background="arquivos/bg.jpg" leftmargin="0" topmargin="15" marginwidth="0" marginheight="10" onLoad="MM_preloadImages('arquivos/ico_cont.gif','arquivos/ico_fav.gif','arquivos/ico_home.gif')"><div id="Layer1" style="position:absolute; left:145px; top:253px; width:573px; height:445px; z-index:1;"> <br> <table width="594" height="150" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="106"> <% 'Abre o Recordset para todas as noticiasSet RS = Server.CreateObject( "ADODB.Recordset" )RS.ActiveConnection = connRS.open "SELECT TOP 13 id, manchete, data, data_simples FROM Noticias ORDER BY data DESC" %><% if not rs.eof then while not rs.eof %> <table width="581" height="40" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="5" colspan="2"><img src="noticias/arquivos/linha.gif" width="580" height="1"></td> </tr> <tr class="texto"> <td width="480"> <div align="left"><a href="vernoticia.asp?id=<%=rs("id")%>"> <%=rs("data_simples")%> - <%=rs("manchete")%></a> </div></td> <td width="101"><strong><a href="vernoticia.asp?id=<%=rs("id")%>">< saiba mais ></a></strong></td> </tr> </table> <%rs.Movenextwendend if%> </td> </tr> <tr> <td height="44"><table width="407" border="0" align="center" cellpadding="0" cellspacing="0" class="texto"> <tr> <td width="184"><div align="right"><strong>< página anterior</strong></div></td> <td width="27"> <div align="center">·</div></td> <td width="196"> <strong>página seguinte > </strong></td> </tr> </table></td> </tr> </table></div><a name="topo"></a> <table width="779" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="6"><img src="arquivos/shim.gif" width="6" height="1" border="0"></td> <td width="6"><img src="arquivos/shim.gif" width="6" height="1" border="0"></td> <td width="1"><img src="arquivos/shim.gif" width="1" height="1" border="0"></td> <td width="1"><img src="arquivos/shim.gif" width="1" height="1" border="0"></td> <td width="56"><img src="arquivos/shim.gif" width="56" height="1" border="0"></td> <td width="16"><img src="arquivos/shim.gif" width="16" height="1" border="0"></td> <td width="34"><img src="arquivos/shim.gif" width="34" height="1" border="0"></td> <td width="43"><img src="arquivos/shim.gif" width="43" height="1" border="0"></td> <td width="84"><img src="arquivos/shim.gif" width="84" height="1" border="0"></td> <td width="51"><img src="arquivos/shim.gif" width="51" height="1" border="0"></td> <td width="7"><img src="arquivos/shim.gif" width="7" height="1" border="0"></td> <td width="11"><img src="arquivos/shim.gif" width="11" height="1" border="0"></td> <td width="88"><img src="arquivos/shim.gif" width="88" height="1" border="0"></td> <td width="65"><img src="arquivos/shim.gif" width="65" height="1" border="0"></td> <td width="79"><img src="arquivos/shim.gif" width="79" height="1" border="0"></td> <td width="99"><img src="arquivos/shim.gif" width="99" height="1" border="0"></td> <td width="6"><img src="arquivos/shim.gif" width="6" height="1" border="0"></td> <td width="113"><img src="arquivos/shim.gif" width="113" height="1" border="0"></td> <td width="3"><img src="arquivos/shim.gif" width="3" height="1" border="0"></td> <td width="4"><img src="arquivos/shim.gif" width="4" height="1" border="0"></td> <td width="5"><img src="arquivos/shim.gif" width="5" height="1" border="0"></td> <td width="1"><img src="arquivos/shim.gif" width="1" height="1" border="0"></td> </tr> <tr valign="top"> <!-- row 2 --> <td colspan="22"> <!--Início do Topo--> <iframe src="topo.asp" width="778" height="156" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe> <!--Fim do Topo --> </td> </tr> <tr valign="top"> <!-- row 5 --> <td colspan="21" bgcolor="#FFFFFF"><img src="arquivos/shim.gif" width="778" height="8"></td> <td><img src="arquivos/shim.gif" width="1" height="8" border="0"></td> </tr> <tr valign="top"> <!-- row 6 --> <td rowspan="35" bgcolor="#FFFFFF"> </td> <td colspan="15" rowspan="35" bgcolor="#FFFFFF"> <table width="640" height="763" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="30" height="48"> </td> <td width="610"><table width="583" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="583" background="noticias/arquivos/bg_noticias3.gif"><img src="noticias/arquivos/todas.gif" width="220" height="30"></td> </tr> </table></td> </tr> <tr> <td height="715"> </td> <td> </td> </tr> </table></td> <td rowspan="35" bgcolor="#FFFFFF"> </td> <td colspan="3" rowspan="26" bgcolor="#FFFFFF"><img src="arquivos/banner.gif" width="120" height="599"></td> <td rowspan="35" bgcolor="#FFFFFF"> </td> <td><img src="arquivos/shim.gif" width="1" height="76" border="0"></td> </tr> <tr valign="top"> <!-- row 7 --> <td><img src="arquivos/shim.gif" width="1" height="15" border="0"></td> </tr> <tr valign="top"> <!-- row 8 --> <td><img src="arquivos/shim.gif" width="1" height="153" border="0"></td> </tr> <tr valign="top"> <!-- row 9 --> <td><img src="arquivos/shim.gif" width="1" height="4" border="0"></td> </tr> <tr valign="top"> <!-- row 10 --> <td><img src="arquivos/shim.gif" width="1" height="18" border="0"></td> </tr> <tr valign="top"> <!-- row 11 --> <td><img src="arquivos/shim.gif" width="1" height="11" border="0"></td> </tr> <tr valign="top"> <!-- row 12 --> <td><img src="arquivos/shim.gif" width="1" height="53" border="0"></td> </tr> <tr valign="top"> <!-- row 13 --> <td><img src="arquivos/shim.gif" width="1" height="7" border="0"></td> </tr> <tr valign="top"> <!-- row 14 --> <td><img src="arquivos/shim.gif" width="1" height="8" border="0"></td> </tr> <tr valign="top"> <!-- row 15 --> <td><img src="arquivos/shim.gif" width="1" height="6" border="0"></td> </tr> <tr valign="top"> <!-- row 16 --> <td><img src="arquivos/shim.gif" width="1" height="52" border="0"></td> </tr> <tr valign="top"> <!-- row 17 --> <td><img src="arquivos/shim.gif" width="1" height="7" border="0"></td> </tr> <tr valign="top"> <!-- row 18 --> <td><img src="arquivos/shim.gif" width="1" height="8" border="0"></td> </tr> <tr valign="top"> <!-- row 19 --> <td><img src="arquivos/shim.gif" width="1" height="7" border="0"></td> </tr> <tr valign="top"> <!-- row 20 --> <td><img src="arquivos/shim.gif" width="1" height="51" border="0"></td> </tr> <tr valign="top"> <!-- row 21 --> <td><img src="arquivos/shim.gif" width="1" height="7" border="0"></td> </tr> <tr valign="top"> <!-- row 22 --> <td><img src="arquivos/shim.gif" width="1" height="8" border="0"></td> </tr> <tr valign="top"> <!-- row 23 --> <td><img src="arquivos/shim.gif" width="1" height="6" border="0"></td> </tr> <tr valign="top"> <!-- row 24 --> <td><img src="arquivos/shim.gif" width="1" height="4" border="0"></td> </tr> <tr valign="top"> <!-- row 25 --> <td><img src="arquivos/shim.gif" width="1" height="14" border="0"></td> </tr> <tr valign="top"> <!-- row 26 --> <td><img src="arquivos/shim.gif" width="1" height="22" border="0"></td> </tr> <tr valign="top"> <!-- row 27 --> <td><img src="arquivos/shim.gif" width="1" height="12" border="0"></td> </tr> <tr valign="top"> <!-- row 28 --> <td><img src="arquivos/shim.gif" width="1" height="7" border="0"></td> </tr> <tr valign="top"> <!-- row 29 --> <td><img src="arquivos/shim.gif" width="1" height="8" border="0"></td> </tr> <tr valign="top"> <!-- row 30 --> <td><img src="arquivos/shim.gif" width="1" height="6" border="0"></td> </tr> <tr valign="top"> <!-- row 31 --> <td><img src="arquivos/shim.gif" width="1" height="29" border="0"></td> </tr> <tr valign="top"> <!-- row 32 --> <td colspan="3" rowspan="3" bgcolor="#FFFFFF"> </td> <td><img src="arquivos/shim.gif" width="1" height="23" border="0"></td> </tr> <tr valign="top"> <!-- row 33 --> <td><img src="arquivos/shim.gif" width="1" height="7" border="0"></td> </tr> <tr valign="top"> <!-- row 34 --> <td><img src="arquivos/shim.gif" width="1" height="2" border="0"></td> </tr> <tr valign="top"> <!-- row 35 --> <td colspan="3" rowspan="6" bgcolor="#FFFFFF"> </td> <td><img src="arquivos/shim.gif" width="1" height="6" border="0"></td> </tr> <tr valign="top"> <!-- row 36 --> <td><img src="arquivos/shim.gif" width="1" height="6" border="0"></td> </tr> <tr valign="top"> <!-- row 37 --> <td><img src="arquivos/shim.gif" width="1" height="52" border="0"></td> </tr> <tr valign="top"> <!-- row 38 --> <td><img src="arquivos/shim.gif" width="1" height="10" border="0"></td> </tr> <tr valign="top"> <!-- row 39 --> <td><img src="arquivos/shim.gif" width="1" height="23" border="0"></td> </tr> <tr valign="top"> <!-- row 40 --> <td height="14"><img src="arquivos/shim.gif" width="1" height="8" border="0"></td> </tr> <tr valign="top"> <!-- row 49 --> <td height="19" colspan="22"> <!--Início do rodape--> <iframe src="rodape2.asp" width="778" height="40" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe> <!--Fim do rodape --> <% RS.Close db.Close %> </td> </tr></table></body></html>faça o seguinte
on error resume nextSet db = server.createobject("adodb.connection")'data = "Driver={MySQL ODBC 3.51 Driver}; SERVER=mysql.w3.net2.com.br; DATABASE=vcszone; UID=vcszone; PWD=strike;" data = "Driver={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=meubanco; UID=meuid; PWD=minhasenha;" db.CursorLocation = 3db.open dataif err.number<>0 thenresponse.write("erro codigo:"&err.number&"-"&err.description)response.end()elseresponse.write("conseguiu conectar com o Db Mysql")response.end()end ifpra mim seu erro não está na conexão, mas sim nessa linha
RS.ActiveConnection = conn
você está mandando usar objeto CONN só que você criou o DB
Valeu J. esse problema do CONN consegui vê nestante aqui.... e já está resolvido.Até que fim o asp conectou ao db. Mas ainda tem um porém: <% 'Abre o Recordset para todas as noticiasSet RS = Server.CreateObject( "ADODB.Recordset" )RS.ActiveConnection = dbRS.open "SELECT TOP 13 id, manchete, data, data_simples FROM Noticias ORDER BY data DESC" %>Toda vez que tiro o 'TOP 13' ele faz tudo beleza..... Quando coloco o bendito (que é justamente limitar a exibição a 13 ocorrências) ele dá erro.Logo, o erro pode estar no 'TOP 13' e aí o que você acha broder?
mysql não usa TOP, usa-se LIMIT...ficaria assimRS.open "SELECT id, manchete, data, data_simples FROM Noticias ORDER BY data DESC LIMIT 13"
pow cara n sei como agradecer velho..... Brigadaaaaaaaaaço mesmo.Precisando de alguma coisa bicho, meu email é esse adm@radioagitabrasil.comUm abraço e sucesso
beleza......boa sorte
Que erro está acontecendo?