Jump to content


Photo

Banco De Dados


  • Faça o login para participar
23 replies to this topic

#16 cybermix

cybermix

    andrewsmedina.com.br

  • Ex-Admins
  • 3586 posts
  • Sexo:Não informado
  • Localidade:Não sou desse planeta não!!!!
  • Interesses:python, fireworks, linux, php, flash...

Posted 18/09/2003, 10:33

tenta usar esse codigo aqui

<!-- #INCLUDE FILE="inc.asp" -->
<!-- #INCLUDE FILE="AdminINC.asp" -->
<head>
<title></title>
</head>
<body topmargin="0" leftmargin="0" bgcolor="#FFFFFF" text="#211852" link="#211852" vlink="#211852" alink="#211852">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr> 
   <td width="25%" bgcolor="#9CCEFF" align="center">
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open dsn

mySQL1 = "SELECT * from Festa where FestaID = " & request.querystring("FestaID") & ""
set rs = conn.execute(mysql1)
%><b><%= rs("Festa") %></b><br><%= ors("Data") %>
</td>
 </tr>
</table>
<%
FestaID = request.querystring("FestaID")

Set Myconn = Server.CreateObject("ADODB.Connection")
Myconn.Open DB_CONNECTIONSTRING
SET MYTABLE= SERVER.CREATEOBJECT("ADODB.RECORDSET")
mySQL = "select * from Fotos WHERE FestaID = " & request.querystring("FestaID") & ""
iPageSize = AdminRS.fields("NoResults")

If Request.QueryString("pagina") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("pagina"))
End If

mytable.PageSize = iPageSize
mytable.CacheSize = iPageSize
mytable.open mysql,myconn,3,3
iPageCount = mytable.PageCount

If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1

mytable.AbsolutePage = iPageCurrent

For I = 0 To mytable.Fields.Count - 1
    
Next 

iRecordsShown = 0
Do While iRecordsShown < iPageSize And Not mytable.EOF

%>
<div align="center">
 <center>
   <table border="0" cellspacing="0" cellpadding="0">
     <tr> 
       <td bgcolor="#DEE7F7"><a href="bigpicture.asp?id=<%= mytable.fields("id").value %>"><img src="Fotos/<%= mytable.fields("Foto") %>.jpg" width="120" height="90" border="0"></a></td>
     </tr>
  <tr>
       <td height=10 align="center">----------------</td>
  </tr>
   </table>
 </center>
</div>
<% 
iRecordsShown = iRecordsShown + 1
mytable.MoveNext
Loop
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td width="33%" bgcolor="#9CCEFF">
     <p align="center"><font color="#211852" face="Arial"><%If iPageCurrent > 1 Then
%>
     <a href="ShowCat.asp?FestaID=<%= FestaID %>&pagina=<%= iPageCurrent - 1 %>">&lt;&lt;
Previous</a><%
End If %></font></p>
   </td>
   <td width="33%" bgcolor="#9CCEFF">
     <p align="center"><font color="#211852" face="Arial"><%
' You can also show page numbers:
For I = 1 To iPageCount
If I = iPageCurrent Then
 %>
 <%= I %>
 <%
Else
 %>
 <a href="ShowCat.asp?FestaID=<%= FestaID %>&pagina=<%= I %>"><%= I %></a>
 <%
End If
Next 'I %>
     </font>
</td>
   <td width="34%" bgcolor="#9CCEFF">
     <p align="center"><font color="#211852" face="Arial"><% 'next button
If iPageCurrent < iPageCount Then
%>
<a href="ShowCat.asp?FestaID=<%= FestaID %>&pagina=<%= iPageCurrent + 1 %>">Next &gt;&gt;</a>
<%
End If %></font></p>
   </td>
 </tr>
</table>
<%
AdminRS.close
%>

www.andrewsmedina.com.br

#17 D-Style

D-Style

    12 Horas

  • Usuários
  • 133 posts
  • Sexo:Não informado

Posted 18/09/2003, 10:40

cybermix,

Agora ta dando esse erro:

Tipo de erro:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Nome da fonte de dados não encontrado e nenhum driver padrão especificado
/Testes/Galeria/Minha galeria/menu2.asp, line 12


E agora?

Abraços!

#18 cybermix

cybermix

    andrewsmedina.com.br

  • Ex-Admins
  • 3586 posts
  • Sexo:Não informado
  • Localidade:Não sou desse planeta não!!!!
  • Interesses:python, fireworks, linux, php, flash...

Posted 18/09/2003, 10:52

ele nao acho o dsn ele esta correto ?
www.andrewsmedina.com.br

#19 D-Style

D-Style

    12 Horas

  • Usuários
  • 133 posts
  • Sexo:Não informado

Posted 19/09/2003, 11:21

O dns tava com erro, mas eu já ajeitei. Agora ele tá dando o mesmo erro q tava dando antes, só mudou a linha:

Tipo de erro:
Microsoft JET Database Engine (0x80040E07)
Tipo de dados imcompatível na expressão de critério.
/Testes/Galeria/Minha galeria/menu.asp, line 37

Essa linha aí ainda tá me deixando na duvida...
mytable.open mysql,myconn,3,3
E agora?

Abraços!

#20 D-Style

D-Style

    12 Horas

  • Usuários
  • 133 posts
  • Sexo:Não informado

Posted 22/09/2003, 14:25

e ai galera? ninguém pode ajudar?

#21 Nicholas Pufal

Nicholas Pufal

    Impossível: só existe até alguém duvidar e provar o contrário.

  • Usuários
  • 1655 posts
  • Sexo:Masculino
  • Localidade:Porto Alegre

Posted 22/09/2003, 14:56

Tenta fazer assim:

mytable.open mysql,myconn,3,1


Abraços
BLOG Touché Criação - Vamos trocar idéias? -> http://blog.touchecriacao.com.br/
// Links úteis: Busca || Regras
// Não respondo dúvidas via mensagem privada. Use o fórum para buscar ou perguntar.

#22 D-Style

D-Style

    12 Horas

  • Usuários
  • 133 posts
  • Sexo:Não informado

Posted 24/09/2003, 14:16

Firehalk,

nada... o mesmo erro continua aparecendo...
:(

Abraços!

#23 cybermix

cybermix

    andrewsmedina.com.br

  • Ex-Admins
  • 3586 posts
  • Sexo:Não informado
  • Localidade:Não sou desse planeta não!!!!
  • Interesses:python, fireworks, linux, php, flash...

Posted 24/09/2003, 15:04

d-style,
nesse codigo, há muita "poluicao" vo explicar ex:

iPageSize = AdminRS.fields("NoResults")%>

esse adminrs vem de um include? se nao ele nao funcionara pq nao esta definido o que ele é.

mytable.open mysql,myconn,3

teste usar
mytable.open mysql,myconn
para que as propiredades sejam as padroes

ve se vai adiantar ok?
www.andrewsmedina.com.br

#24 D-Style

D-Style

    12 Horas

  • Usuários
  • 133 posts
  • Sexo:Não informado

Posted 25/09/2003, 12:02

cybermix,

Não adiantou... O erro continua aparecendo...

d-style,
nesse codigo, há muita "poluicao" vo explicar ex:

iPageSize = AdminRS.fields("NoResults")%>

esse adminrs vem de um include? se nao ele nao funcionara pq nao esta definido o que ele é.


O AdminRS vem de um include sim...

vc disse q o código está mto poluído... realmente, ele tá meio complicado... como nós poderíamos limpá-lo? pq, sinceramente, eu não sei como fazer isso...
:blink:
Abraços!




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq