Ir para conteúdo
Fórum Script Brasil
  • 0

Não Funciona....


turboibest

Pergunta

Olá amigos

Sou novo com programação ASP e já estou com uma dúvida. Eu baixei na net um script de album de fotos e quando eu o executo ele da o seguinte erro:

Microsoft OLE DB Provider for ODBC Drivers error '80004005' 

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xacc Thread 0x2400 DBC 0x865cfa4 Jet'. 

/1.1/site/phgallery/Default.asp, line 17

O que pode ser que esta configurado errado???

Desde já, obrigado

Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

Ai via o arquivo default.asp que esta dando erro na linha 17:

<!-- #include file="dbsite.asp" -->
<!-- #include file="lang.asp" -->
<!-- #include file="W3Lib.asp" -->

<% 
If giEnabled Then
    DoPageHeader
 Session("ReturnPath") = "default.asp"
 my_Conn.Open ConnString
 sql ="select * from config"
 RS.open sql, my_Conn, 1, 3
 CatNum = RS("CatNum")
 GalNum = RS("GalNum")
 RS.Close
%>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="95%"><TR><TD bgcolor="#4B96D3"><CENTER>&nbsp;<FONT FACE="Tahoma" SIZE="2" COLOR="#FFFFFF"><B><%=W3_sGalleries%></B></FONT>&nbsp;</CENTER></TD><TD align=right bgcolor="#FFFFFF" WIDTH="65%"><FONT face=Tahoma color=#000080 size=1><%=W3_sCount1%><B><%=GalNum%></B><%=W3_sCount2%><B><%=CatNum%></B><%=W3_sCount3%></FONT></TD></TR><TR><TD COLSPAN="2" bgcolor="#4B96D3" HEIGHT="2"><IMG BORDER="0" SRC="XcDirImages/pix.gif" WIDTH="1" HEIGHT="1"></TD></TR></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<%
 sql ="select * from category WHERE rootid=0"
 RS.open sql, my_Conn, 1, 3
 iLine = 0
 Do Until RS.EOF
 CatName = RS("name")
 CatDesc = "" & RS("desc")
 CatId = RS("catid")
 CatGalNum = RS("galnum")
 If (iLine=0) Then
  iLine = 1
%>
<TR>
 <TD vAlign=top width="50%">
  <FONT face=TAHOMA size=3><B>
  <DIV class=DirMainCatLink>
   <A href="showsub.asp?id=<%=CatId%>"><%=CatName%></A>(<%=CatGalNum%>)
<%
 If Session("Rights")>0 Then
  Response.Write "<a href='delsub.asp?id=" & CatId & "'><img src='images\delete.gif' border=0></a>"
 End If
%>
<br>
   <%=CatDesc%>
  </DIV></B>
  </FONT>
  <FONT face=TAHOMA size=1>
  <DIV class=DirSubCatLink>
<%
 sql ="select * from category where rootid=" & CatId
 RS2.MaxRecords = 3
 RS2.open sql, my_Conn, 1, 3
 CycleTo = RS2.RecordCount
 If CycleTo > 3 Then
  CycleTo = 3
 End If
 For J=1 to CycleTo
%>
   <A href="showsub.asp?id=<%=RS2("catid")%>"><%=RS2("name")%></A>(<%=RS2("galnum")%>), 
<%
 RS2.MoveNext
 Next
 RS2.Close
%>
   ...
  </DIV>
  </FONT>
 </TD>
<%
 Else
%>
 <TD vAlign=top width="50%">
  <FONT face=TAHOMA size=3><B>
  <DIV class=DirMainCatLink>
   <A href="showsub.asp?id=<%=CatId%>"><%=CatName%></A>(<%=CatGalNum%>)
<%
 If Session("Rights")>0 Then
  Response.Write "<a href='delsub.asp?id=" & CatId & "'><img src='images\delete.gif' border=0></a>"
 End If
%>
<br>
   <%=CatDesc%>
  </DIV></B>
  </FONT>
  <FONT face=TAHOMA size=1>
  <DIV class=DirSubCatLink>
<%
 sql ="select * from category where rootid=" & CatId
 RS2.MaxRecords = 3
 RS2.open sql, my_Conn, 1, 3
 CycleTo = RS2.RecordCount
 If CycleTo > 3 Then
  CycleTo = 3
 End If
 For J=1 to CycleTo
%>
   <A href="showsub.asp?id=<%=RS2("catid")%>"><%=RS2("name")%></A>(<%=RS2("galnum")%>), 
<%
 RS2.MoveNext
 Next
 RS2.Close
%>
   ...
  </DIV>
  </FONT>
 </TD>
</TR>
<%
 iLine = 0
 End If
 RS.MoveNext
 Loop
 RS.Close
%>

<TR><TD colSpan=2><SMALL>&nbsp;</SMALL></TD></TR>
<!-- Hot -->
<TR>
 <TD vAlign=top>
 <DIV class=DirDefaultLinks>
 <TABLE cellSpacing=0 cellPadding=1 width="95%" border=0>
 <TBODY>
 <TR>
  <TD bgColor=#ffffff colspan=2><SMALL>&nbsp;</SMALL><FONT 
  face=Tahoma color=#000080 size=2><B><%=W3_sGalPopular%></B></FONT><SMALL>&nbsp;</SMALL></TD>
</TR>
<TR bgColor=#000000>
 <TD colSpan=2>
 <TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff border=0>
 <TBODY>
 <TR bgColor=#e9e9e9>
  <TD><SMALL><SMALL>&nbsp;</SMALL></SMALL></TD>
  <TD><FONT face=Tahoma size=2><B><%=W3_sGalName%></B></FONT></TD>
  <TD><FONT face=Tahoma size=2><B><center><%=W3_sGalVisits%></center></B></FONT></TD></TR>
<%
 sql ="select * from gallery order by visits DESC, id DESC"
 RS.MaxRecords = 5
 RS.open sql, my_Conn, 1, 3
 NumRec = RS.RecordCount
 If NumRec > 5 Then
  NumRec = 5
 End If
 For I=1 to NumRec
%>
 <TR>
  <TD vAlign=top><FONT face=TAHOMA size=2><%=I%>.</FONT></TD>
  <TD vAlign=top><FONT face=TAHOMA size=2><A
  href="showgal.asp?id=<%=RS("id")%>"><%=RS("name")%></A></FONT></TD>
  <TD vAlign=top><FONT face=TAHOMA size=2><center><%=RS("visits")%></center></FONT></TD></TR>
<%
 RS.MoveNext
 Next
 RS.close
%>
</TBODY></TABLE>
</TD></TR></TBODY></TABLE>
</DIV></TD>
<!-- New -->
<TD vAlign=top>
<DIV class=DirDefaultLinks>
<TABLE cellSpacing=0 cellPadding=1 width="95%" border=0>
<TBODY>
<TR>
<TD bgColor=#ffffff colspan=2><SMALL>&nbsp;</SMALL><FONT face=Tahoma color=#000080 
size=2><B><%=W3_sNewGalleries%></B></FONT><SMALL>&nbsp;</SMALL></TD>
</TR>
<TR bgColor=#000000>
<TD colSpan=2>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff border=0>
<TBODY>
<TR bgColor=#e9e9e9>
 <TD><SMALL><SMALL>&nbsp;</SMALL></SMALL></TD>
 <TD><FONT face=Tahoma size=2><B><%=W3_sGalName%></B></FONT></TD>
 <TD><FONT face=Tahoma size=2><B><center><%=W3_sDate%></center></B></FONT></TD>
</TR>
<%
 sql ="select * from gallery order by date DESC, id DESC"
 RS.MaxRecords = 5
 RS.open sql, my_Conn, 1, 3
 NumRec = RS.RecordCount
 If NumRec > 5 Then
  NumRec = 5
 End If
 For I=1 to NumRec
%>
 <TR>
  <TD vAlign=top><FONT face=TAHOMA size=2><%=I%>.</FONT></TD>
  <TD vAlign=top><FONT face=TAHOMA size=2><A href="showgal.asp?id=<%=RS("id")%>"><%=RS("name")%></A></FONT></TD>
  <TD vAlign=top><FONT face=TAHOMA size=2><center><%=RS("date")%></center></FONT></TD>
</TR>
<%
 RS.MoveNext
 Next
 RS.close
%>
</TBODY></TABLE></TD>
</TR>
</TBODY></TABLE>
</DIV></TD>
</TR>

<TR><TD colSpan=2><SMALL>&nbsp;</SMALL></TD></TR>
<TR bgColor=#000080><TD colSpan=2></TD></TR>

<%
 my_Conn.Close
%><!-- #include file="mainfoot.inc" --><%    
 DoPageFooter
Else
	Response.Redirect "W3Disabled.asp"
End If
%>
Agora vai o arquivo de conexão com o db (dbsite.asp):
<%
ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("gallery.mdb")

set my_conn= Server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.RecordSet")
set rs2 = server.CreateObject("ADODB.RecordSet")
set rsuser = server.CreateObject("ADODB.RecordSet")
HomePath = "d:\activenet\users\taquarinet\dados\"

Function ChkString(str)  
  str = replace(str, "<", "&lt;", 1, -1, 1)
  str = replace(str, ">", "&gt;", 1, -1, 1)
  ChkString = str
End Function
%>

Desde já, obrigado

Link para o comentário
Compartilhar em outros sites

  • 0

<%

ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("gallery.mdb")

set my_conn= Server.CreateObject("ADODB.Connection")

set rs = server.CreateObject("ADODB.RecordSet")

set rs2 = server.CreateObject("ADODB.RecordSet")

set rsuser = server.CreateObject("ADODB.RecordSet")

HomePath = "d:\activenet\users\taquarinet\dados\"

Function ChkString(str) 

str = replace(str, "<", "&lt;", 1, -1, 1)

str = replace(str, ">", "&gt;", 1, -1, 1)

ChkString = str

End Function

%>

Pelo que eu vi acima, você não abriu o BD, você deve acrescentar esta linha:

my_conn.Open ConnString

Assim deve funcionar.

Link para o comentário
Compartilhar em outros sites

  • 0

e aonde você chama ele? o default.asp

<% 
If giEnabled Then
   DoPageHeader
Session("ReturnPath") = "default.asp"
my_Conn.Open ConnString
sql ="select * from config"
RS.open sql, my_Conn, 1, 3
CatNum = RS("CatNum")
GalNum = RS("GalNum")
RS.Close
%>

Aqui?? tenta colocar include... e nesse if tá faltando o end!

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...