USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  ASP - Active Server Page
Voltar
Autor Assunto:  busca
Korn
Pontos: 2843
SAO PAULO
SP - BRASIL
Postada em 19/02/2005 12:45 hs            
alguem sabe fazer um formulario de busca , com banco armazenado produto etc,alguem tem algum exemplo, valeu obrigado

Jesus Cristo é O Senhor!!!
     
Martini
Pontos: 2843 Pontos: 2843
PAROBÉ
RS - BRASIL
Postada em 19/02/2005 23:33 hs         
código do arquivo que recebe o valor digitado no form (nome do produto a ser pesquisado) e procura no banco de dados.
 
 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Conexao_bd.asp" -->
<%
  Dim SQL, rst, Contador, i, Pagina, Origem, Nome
 Nome = Request("Nome")
 Pagina = trim(Request("Pag"))
 SQL = "SELECT Filmes.[Codigo do filme], Filmes.[Tipo produto], Categorias.[Nome da categoria], Filmes.[Nome do filme] FROM Categorias INNER JOIN Filmes ON Categorias.[Codigo da categoria] = Filmes.[Codigo da categoria] WHERE Filmes.[Nome do filme] LIKE '%" & Nome & "%' ORDER BY Filmes.[Nome do filme];"
 Set rst = server.createobject("adodb.recordset")
 rst.open SQL, vgdb, 1, 1
 if rst.eof then
   Response.Redirect("Default.asp")
 end if   
 if Pagina = "" then Pagina = 1
 Contador = ((Pagina - 1) * 42 ) + 1
 rst.pagesize = 42
 rst.absolutepage = Pagina
%>
<html>
<style type="text/css">
<!--
BODY {
 SCROLLBAR-FACE-COLOR: #2769AB;
 SCROLLBAR-HIGHLIGHT-COLOR: #0099FF;
 SCROLLBAR-SHADOW-COLOR: #0099FF;
 SCROLLBAR-3DLIGHT-COLOR: #0099FF;
 SCROLLBAR-ARROW-COLOR:  #0099FF;
 SCROLLBAR-TRACK-COLOR: #ffffff;
 SCROLLBAR-DARKSHADOW-COLOR: #ffffff;
}
-->
</style>
<head>
<link rel="stylesheet" href="Estilos.css" type="text/css">
<title>Locadora de Filmes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="2" topmargin="2" marginwidth="2" marginheight="2">
<table width="604" height="700">
  <tr>
    <td width="604" height="700" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="70%" class="BordaBaixa"><font class="TextoPadraoPreto"><strong>Nome</strong></font></td>
          <td width="30%" class="BordaBaixa"><font class="TextoPadraoPreto"><strong>Categoria</strong></font></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <%
     while not rst.eof And Contador <= (rst.PageSize * Pagina)'enquanto não chegar no fim da tabela
    %>
        <tr>
          <td width="70%"><a href="Lista_Filme_Detalhes.asp?Codigo=<% = rst("Codigo do filme") %>" class="LinkPadraoLista">
            <% = rst("Nome do filme") %></td>
          <td width="30%"><font class="TextoPadraoPreto">
            <% = rst("Nome da categoria") %>
            </font></td>
        </tr>
        <%
      Contador = Contador + 1 
      rst.movenext
     wend  
    %>
        <tr>
          <td colspan="2" align="right">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2" align="right" class="BordaAlta">
     <% 
      if rst.PageCount > 1 then
       if Pagina = 1 then
        Response.Write("<div align=" & "right" & "><a href="& "Consulta_Filme_Nome_Resultado.asp?Pag=" & (Pagina + 1) & "&Nome=" & Nome & " class=" & "'LinkPadraoLista'" & "><strong>Próxima</strong></a></div>")
       else
        If (Pagina  + 1) > rst.pagecount then
         Response.Write("<div align=" & "right" & "><a href="& "Consulta_Filme_Nome_Resultado.asp?Pag=" & (Pagina - 1) & "&Nome=" & Nome & " class=" & "'LinkPadraoLista'" & "><strong>Anterior</strong></a></div>")
        elseif (Pagina  - 1) < 1 then
         Response.Write("<div align=" & "right" & "><a href="& "Consulta_Filme_Nome_Resultado.asp?Pag=" & (Pagina + 1) & "&Nome=" & Nome & " class=" & "'LinkPadraoLista'" & "><strong>Próxima</strong></a></div>")
        else
         Response.Write("<a href="& "Consulta_Filme_Nome_Resultado.asp?Pag=" & (Pagina - 1) & "&Nome=" & Nome & " class=" & "'LinkPadraoLista'" & "><strong>Anterior - </strong></a>" & "<a href="& "Consulta_Filme_Nome_Resultado.asp?Pag=" & (Pagina + 1) & "&Nome=" & Nome & " class=" & "'LinkPadraoLista'" & "><strong>Próxima</strong></a>")
        end if 
       end if 
      end if
      rst.close
      set rst = nothing 
     %> </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
     
Korn
Pontos: 2843
SAO PAULO
SP - BRASIL
Postada em 20/02/2005 15:12 hs            
cara num estou querendo abusar, e desculpa minha ignorancia , eu to meio q voltando a usar asp e estou meio lento , mas o nome do bd seria qual , e qual o nome do formularoi feito em htm, e quais sao os campos do bd? qual o nome do feito em asp? pq eu coloquei o nome de text.html , e apareceu uma pagina escrita nome e categoria, e um linkpadraoLista, so que quando aperto ele a pagina da pau ,obrigado desculpe o trampo

Jesus Cristo é O Senhor!!!
TÓPICO EDITADO
   
Korn
Pontos: 2843
SAO PAULO
SP - BRASIL
Postada em 21/02/2005 16:19 hs            
ola

Jesus Cristo é O Senhor!!!
     
Korn
Pontos: 2843
SAO PAULO
SP - BRASIL
Postada em 21/02/2005 16:26 hs            
em um eu coloquei o test.html e no outro agora eu puis Lista_Filme_Detalhes.asp, ae na hora que eu aperto o link no form html , ele abre uma tela q pra salbar um documento que seria o proprio form, num entendi pode me dar um help

Jesus Cristo é O Senhor!!!
     
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2026   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página