Ir para conteúdo
Fórum Script Brasil

Eduardo Gonçalves

Membros
  • Total de itens

    15
  • Registro em

  • Última visita

Posts postados por Eduardo Gonçalves

  1. Salve salve camaradas... Estou começando a entrar no mundo .NET e fui instalar aqui em casa o Visual Web Developer 2008 Express Edition... Até aí tudo bem... Fiz uma pequena página em ASP.NET e C# apenas para ir me acostumando com a linguagem, porém ao rodar a página, o VWD me apresenta o erro abaixo:

    Error 15 The "Microsoft.Build.Tasks.Windows.GetWinFXPath" task could not be loaded from the assembly PresentationBuildTasks, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. Could not load file or assembly 'PresentationBuildTasks, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. O sistema não pode encontrar o arquivo especificado. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. WebApplication

    Alguma solução para isto???

    Abraços....

  2. Ok...

    <%@ codepage="1252" language="VBScript" %>
    <% response.Charset="ISO-8859-1" %>
    <%
        Set bd = Server.CreateObject("ADODB.Connection")
        Set tb = Server.CreateObject("ADODB.Recordset")
        tb.CursorType = 1
        tb.CursorLocation = 3
        tb.LockType = 2  
        bd.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\bdadmin.mdb;Persist Security Info=False;"
    
        tb.PageSize = 10
        
        Set idlinha = Request.QueryString("idlinha")
        Set idsublinha = Request.QueryString("idsublinha")
        Set t = Request.QueryString("t")
        Set idr = Request.QueryString("id")
        
        if(isEmpty(idsublinha) or idsublinha="") then
            idsublinha = 0
                sql = "SELECT * FROM tbprodutos WHERE idlinha = " & idlinha & ""
        else
                sql = "SELECT * FROM tbprodutos WHERE idlinha = " & idlinha & "AND idsublinha = " & idsublinha & ""
        end if
        
        tb.Open sql, bd    
        
        'Criamos as Validações
        if Request.QueryString("pagina")="" then 
          intpagina = 1
        else
          if cint(Request.QueryString("pagina"))<1 then
            intpagina = 1
          else
            if cint(Request.QueryString("pagina"))>tb.PageCount then  
                intpagina = tb.PageCount
             else
                intpagina = Request.QueryString("pagina")
            end if
          end if    
        end if 
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <style type="text/css">
    body { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;
    scrollbar-base-color: #c5e2cf;
    //
    scrollbar-track-color: #c5e2cf;
    //
    scrollbar-face-color: #c5e2cf;
    //
    scrollbar-highlight-color: #FFFFFF;
    //
    scrollbar-3d-light-color: #ffffff;
    //
    scrollbar-darkshadow-color: #65b384;
    //
    scrollbar-shadow-color: #65b384;
    //
    scrollbar-arrow-color: #000000;
    };
    .tahoma1 {
        font-family: Tahoma;
        font-size: 11px;
    }
    </style>
    <style type="text/css">
    <!--
    .tahoma1J {
        font-family: Tahoma;
        font-size: 12px;
        text-align: justify;
        line-height: 18px;
        letter-spacing: normal;
    }
    a:link {
        font-family: Tahoma;
        font-size: 11px;
        text-decoration: none;
        color: #000000;
    }
    a:visited {
        font-family: Tahoma;
        font-size: 11px;
        text-decoration: none;
        color: #000000;
    }
    a:hover {
        font-family: Tahoma;
        font-size: 11px;
        text-decoration: underline;
        color: #000000;
    }
    a:active {
        font-family: Tahoma;
        font-size: 11px;
        color: #000000;
    }
    -->
    </style>
    <title>Vantagens</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    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);
    //-->
    </script>
    
    <script language="JavaScript1.2" src="../menu_pulldown/mm_menu.js"></script>
    <script LANGUAGE="JavaScript"> var javascript_version = 1.0; </SCRIPT>
    <script LANGUAGE="JavaScript1.1">  javascript_version = 1.1; </SCRIPT>
    <script LANGUAGE=JavaScript>
    
    //****************************************
    //* Abre nova janela centralizada na tela
    //* Sintaxe: URL, Lagura, Altura, Scroll
    //****************************************
    function janela(URL,width,height,scroll)
       {
        xmax=screen.width;
        ymax=screen.height-28; 
        x=(xmax-(width+12))/2;
        y=(ymax-(height+29))/2;
        if (scroll) 
           scr_stat=" scrollbars=yes ";
        else 
           scr_stat=" scrollbars=no ";
        features="resizable=no height="+height+" width="+width+" left="+x+" top="+y+scr_stat;
        features=features+"toolbar=no location=no directories=no status=no menubar=no";
        newwin=window.open(URL,null,features);
        if(javascript_version > 1.0)
          setTimeout('newwin.focus();',250);
       }
    </script>
    
    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    </head>
    
    <body background="fundo_conteudos.gif" leftmargin="25" topmargin="20" marginwidth="00" marginheight="00">
    <div id="Layer3" style="position:absolute; left:2px; top:457px; width:648px; height:19px; z-index:11"> 
      <p align="center" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:9px;"><b>Mostrando 10 produtos.</b><br>
    <%
        if intpagina>1 then 
            Response.Write("<a href='produtos2.asp?pagina=" & intpagina-1 & "&idlinha=" & idlinha & "&idsublinha=" & idsublinha & "'>Anterior</a>&nbsp;&nbsp;") 
        end if
        if StrComp(intpagina,tb.PageCount)<>0 then   
               Response.Write("<a href='produtos2.asp?pagina=" & intpagina + 1 & "&idlinha=" & idlinha & "&idsublinha=" & idsublinha & "'>Próximo</a>")
        end if    
    %>
    
    
      </p> 
    </div>
    <div id="produtos" style="position:absolute; left:0; top:0; width:616px; height:274px; z-index:12">
    <%
        if tb.RecordCount>0 then
            Dim i, k
            Dim id(9)
            Dim thumb(9)
            Dim titulo(9)
            i = 0 
            tb.AbsolutePage = intpagina 
            intrec = 0
            While intrec<tb.PageSize and not tb.eof  
                id(i) = tb.Fields("id")
                thumb(i) = tb.Fields("thumb")
                titulo(i) = tb.Fields("titulo")            
                i = i+1
                 tb.MoveNext
                intrec = intrec + 1
            Wend 
        end if    
    %>
      <table border="0" cellpadding="0" cellspacing="0" width="650">
        <!-- fwtable fwsrc="layout_catalogo.png" fwbase="layout_catalogo.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="1" -->
        <tr> 
          <td><table border="0" cellpadding="0" cellspacing="0" width="650">
              <tr> 
                <td width="471" height="71" valign="middle" align="center"><%
                        Dim linha
                        Dim sublinha
                        select case(idlinha)
                            case 1:
                                linha = "Manipulados"
                            case 2:
                                linha = "Florais"
                            case 3:
                                linha = "Cosméticos"
                            case 4:
                                linha = "Produtos de revenda"
                            case 5:
                                linha = "Maquiagem Antialérgica"
                            case 6:
                                linha = "Linha de Banho"
                            case 7:
                                linha = "Acessórios"
                        end select
                        
                        select case(idsublinha)
                            case 1:
                                sublinha = " - Corpo"
                            case 2:
                                sublinha = " - Rosto"
                            case 3:
                                sublinha = " - Cabelo"
                            case 4:
                                sublinha = " - Mãos e Pés"
                            case 5:
                                sublinha = " - Proteção Solar"
                            case 6:
                                sublinha = " - Linha masculina"
                            case 7:
                                sublinha = " - Baton"
                            case 8:
                                sublinha = " - Lápis"
                            case 9:
                                sublinha = " - Rimel"
                            case 10:
                                sublinha = " - Sabonete"
                            case 11:
                                sublinha = " - Sais de banho"
                            case else
                                sublinha = ""
                        end select
                        
                        Response.Write("<h1>" & linha & "" & sublinha & "</h1>")
                    %></td>
                <td><img name="layout_catalogo_r1_c10" src="images/layout_catalogo_r1_c10.gif" width="179" height="71" border="0" alt=""></td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td><img name="layout_catalogo_r2_c1" src="images/layout_catalogo_r2_c1.gif" width="650" height="14" border="0" alt=""></td>
        </tr>
        <tr> 
          <td><table border="0" cellpadding="0" cellspacing="0" width="650">
              <tr> 
                <td width="17" height="198" background="images/layout_catalogo_r4_c13.gif">&nbsp;</td>
                <td><img name="layout_catalogo_r3_c2" src="images/layout_catalogo_r3_c2.gif" width="24" height="198" border="0" alt=""></td>
                <td><table border="0" cellpadding="0" cellspacing="0" width="92">
                    <tr> 
                      <td width="92" height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(0) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(0) & "&width=89' border='0' /></a><br />" & titulo(0) & "") %></div></td>
                    </tr>
                    <tr> 
                      <td><img name="layout_catalogo_r5_c3" src="images/layout_catalogo_r5_c3.gif" width="92" height="12" border="0" alt=""></td>
                    </tr>
                    <tr> 
                      <td height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(1) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(1) & "&width=89' border='0' /></a><br />" & titulo(1) & "") %></div></td>
                    </tr>
                    <tr> 
                      <td><img name="layout_catalogo_r5_c3" src="images/layout_catalogo_r5_c3.gif" width="92" height="22" border="0" alt=""></td>
                    </tr>
                    <tr> 
                      <td height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(2) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(2) & "&width=89' border='0' /></a><br />" & titulo(2) & "") %></div></td>
                    </tr>
                  </table></td>
                <td><img name="layout_catalogo_r3_c4" src="images/layout_catalogo_r3_c4.gif" width="20" height="198" border="0" alt=""></td>
                <td><table border="0" cellpadding="0" cellspacing="0" width="92">
                    <tr> 
                      <td width="92" height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(3) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(3) & "&width=89' border='0' /></a><br />" & titulo(3) & "") %></div></td>
                    </tr>
                    <tr> 
                      <td><img name="layout_catalogo_r5_c5" src="images/layout_catalogo_r5_c5.gif" width="92" height="12" border="0" alt=""></td>
                    </tr>
                    <tr> 
                      <td width="92" height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(4) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(4) & "&width=89' border='0' /></a><br />" & titulo(4) & "") %>
                          <table border="0" cellpadding="0" cellspacing="0" width="92">
                            <tr> 
                              <td><img name="layout_catalogo_r5_c5" src="images/layout_catalogo_r5_c5.gif" width="92" height="22" border="0" alt=""></td>
                            </tr>
                            <tr> 
                              <td width="92" height="92" valign="top"><div align="center"></div></td>
                            </tr>
                          </table>
                        </div></td>
                    </tr>
                  </table></td>
                <td><img name="layout_catalogo_r3_c6" src="images/layout_catalogo_r3_c6.gif" width="21" height="198" border="0" alt=""></td>
                <td><table border="0" cellpadding="0" cellspacing="0" width="92">
                    <tr> 
                      <td width="92" height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(5) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(5) & "&width=89' border='0' /></a><br />" & titulo(5) & "") %></div></td>
                    </tr>
                    <tr> 
                      <td><img name="layout_catalogo_r5_c7" src="images/layout_catalogo_r5_c7.gif" width="92" height="12" border="0" alt=""></td>
                    </tr>
                    <tr> 
                      <td height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(6) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(6) & "&width=89' border='0' /></a><br />" & titulo(6) & "") %></div></td>
                    </tr>
                    <tr> 
                      <td><img name="layout_catalogo_r5_c7" src="images/layout_catalogo_r5_c7.gif" width="92" height="22" border="0" alt=""></td>
                    </tr>
                    <tr> 
                      <td width="92" height="92" valign="top"><div align="center"></div></td>
                    </tr>
                  </table></td>
                <td><img name="layout_catalogo_r3_c8" src="images/layout_catalogo_r3_c8.gif" width="22" height="198" border="0" alt=""></td>
                <td><table border="0" cellpadding="0" cellspacing="0" width="91">
                    <tr> 
                      <td width="91" height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(7) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(7) & "&width=89' border='0' /></a><br />" & titulo(7) & "") %></div></td>
                    </tr>
                    <tr> 
                      <td><img name="layout_catalogo_r5_c9" src="images/layout_catalogo_r5_c9.gif" width="91" height="12" border="0" alt=""></td>
                    </tr>
                    <tr> 
                      <td width="91" height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(8) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(8) & "&width=89' border='0' /></a><br />" & titulo(8) & "") %>
                          <table border="0" cellpadding="0" cellspacing="0" width="91">
                            <tr> 
                              <td><img name="layout_catalogo_r5_c9" src="images/layout_catalogo_r5_c9.gif" width="91" height="22" border="0" alt=""></td>
                            </tr>
                            <tr> 
                              <td width="91" height="92" valign="top"><div align="center"></div></td>
                            </tr>
                          </table>
                        </div></td>
                    </tr>
                  </table></td>
                <td><img name="layout_catalogo_r3_c10" src="images/layout_catalogo_r3_c10.gif" width="21" height="198" border="0" alt=""></td>
                <td><table border="0" cellpadding="0" cellspacing="0" width="91">
                    <tr> 
                      <td width="91" height="92" valign="top"><div align="center" style="font-size:9px;"><% Response.Write("<a href='produtos_exibe.asp?id=" & id(9) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(9) & "&width=89' border='0' /></a><br />" & titulo(9) & "") %></div></td>
                    </tr>
                    <tr> 
                      <td><img name="layout_catalogo_r5_c11" src="images/layout_catalogo_r5_c11.gif" width="91" height="12" border="0" alt=""></td>
                    </tr>
                    <tr> 
                      <td height="92" valign="top"><div align="center"></div></td>
                    </tr>
                    <tr> 
                      <td><img name="layout_catalogo_r5_c11" src="images/layout_catalogo_r5_c11.gif" width="91" height="22" border="0" alt=""></td>
                    </tr>
                    <tr> 
                      <td width="91" height="91" valign="top">&nbsp;</td>
                    </tr>
                  </table></td>
                <td valign="top"><img name="layout_catalogo_r3_c12" src="images/layout_catalogo_r3_c12.gif" width="37" height="198" border="0" alt=""></td>
                <td valign="top" background="images/layout_catalogo_r4_c13.gif"> 
                  <table width="30" height="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td valign="top"><img src="images/layout_catalogo_r3_c13.gif" alt="" name="layout_catalogo_r3_c13" width="30" height="21" border="0" align="top"></td>
                    </tr>
                    <tr> 
                      <td width="30" height="178" background="images/layout_catalogo_r4_c13.gif">&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td><img name="layout_catalogo_r7_c1" src="images/layout_catalogo_r7_c1.gif" width="650" height="24" border="0" alt=""></td>
        </tr>
      </table>
    </div>
    </body>
    </html>

  3. Ok... está melhorando... tirei a parte solicitada e a página 2 com os resultados apareceram... Mas quando fui para a página 3, nada... o erro persistiu e na mesma linha...

    Eu tenho quase certeza que o erro está nos arrays thumb(), titulo() e id()... pois se tirar todas estas referências e apenas mandar por Response.Write um texto qualquer, ele imprime o texto... Acredito que ao passar para a próxima página, a consulta não esteja sendo refeita... Também não sei como funciona o ASP nesta maneira pos é minha primeira aventura com a linguagem....

  4. Erro de tempo de execução do Microsoft VBScript erro '800a000d'

    Tipos incompatíveis

    /produtos2.asp, line 248

    E a linha 248 é exatamente a que mencionei antes:

    <% Response.Write("<a href='produtos_exibe.asp?id=" & id(0) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(0) & "&width=89' border='0' /></a><br />" & titulo(0) & "") %>

    Att...

  5. <img src='sendBinary.asp?path=c:\images\produtos\" & thumb(0) & "&width=89' border='0' />
    Cara você deixou tudo junto...
    "&width=89'
    , deixe assim, separado
    width='89'
    Rode e poste o resultado !!!!
    Ok mas o
    "&width=89'
    é para concatenar query strings... para ficar mais ou menos assim:
    'sendBinary.asp?path=c:\images\produtos\foto1.jpg&width=89'

    E tem outra coisa.... se o problema fosse aí... a primeira página não exibiria, certo??? Mas exibe... completa... só quando eu vou para a próxima que dá erro...

  6. Salve camaradas... preciso paginar uns resultados em asp e estou encontrando problemas... estou tentando implementar um script sugerido aqui no fórum mas não estou conseguindo... Gostaria de saber se poderia contar com a ajuda de vocês...

    Seguem os códigos...

    Trecho da conexão com o banco e definição de páginas

    <%
        Set bd = Server.CreateObject("ADODB.Connection")
        Set tb = Server.CreateObject("ADODB.Recordset")
        tb.CursorType = 1
        tb.CursorLocation = 3
        tb.LockType = 2  
        bd.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\bdadmin.mdb;Persist Security Info=False;"
    
        tb.PageSize = 10
        
        Set idlinha = Request.QueryString("idlinha")
        Set idsublinha = Request.QueryString("idsublinha")
        Set t = Request.QueryString("t")
        Set idr = Request.QueryString("id")
        
        if(isEmpty(idsublinha) or idsublinha="") then
            idsublinha = 0
                sql = "SELECT * FROM tbprodutos WHERE idlinha = " & idlinha & ""
        else
                sql = "SELECT * FROM tbprodutos WHERE idlinha = " & idlinha & "AND idsublinha = " & idsublinha & ""
        end if
        
        tb.Open sql, bd    
        
        'Criamos as Validações
        if Request.QueryString("pagina")="" then 
          intpagina = 1
        else
          if cint(Request.QueryString("pagina"))<1 then
            intpagina = 1
          else
            if cint(Request.QueryString("pagina"))>tb.PageCount then  
                intpagina = tb.PageCount
             else
                intpagina = Request.QueryString("pagina")
            end if
          end if    
        end if 
    %>
    Trecho que cria os links
    <%
        if intpagina>1 then 
            Response.Write("<a href='produtos2.asp?pagina=" & intpagina-1 & "&idlinha=" & idlinha & "&idsublinha=" & idsublinha & "'>Anterior</a>&nbsp;&nbsp;") 
        end if
        if StrComp(intpagina,tb.PageCount)<>0 then   
               Response.Write("<a href='produtos2.asp?pagina=" & intpagina + 1 & "&idlinha=" & idlinha & "&idsublinha=" & idsublinha & "'>Próximo</a>")
        end if    
    %>
    E por fim, o trecho que pega os resultados da consulta
    <%
        if tb.RecordCount>0 then
            Dim i, k
            Dim id(9)
            Dim thumb(9)
            Dim titulo(9)
            i = 0 
            tb.AbsolutePage = intpagina 
            intrec = 0
            While intrec<tb.PageSize and not tb.eof  
                id(i) = tb.Fields("id")
                thumb(i) = tb.Fields("thumb")
                titulo(i) = tb.Fields("titulo")            
                i = i+1
                 tb.MoveNext
                intrec = intrec + 1
            Wend 
        end if    
    %>
    O que ocorre é que ao clicar no link 'Próximo', dá erro de tipo incompatível quando eu faço isto:
    <% Response.Write("<a href='produtos_exibe.asp?id=" & id(0) & "' target='_blank'><img src='sendBinary.asp?path=c:\images\produtos\" & thumb(0) & "&width=89' border='0' /></a><br />" & titulo(0) & "") %>

    Grato desde já pela ajuda de vocês...

  7. Olá camaradas... Estou iniciando em ASP e estou tendo alguns problemas que creio que são básicos... É o seguinte... ao executar uma página com o código abaixo

    tb.Open sql, bd     
        if tb.RecordCount>0 then
            Dim i
            Dim id(10,10)
            Dim thumb(10,10)
            Dim titulo(10,10)
            i = 1 
            while not tb.EOF
                Set id(i) = tb.Fields("id")
                Set thumb(i) = tb.Fields("tumb")
                Set titulo(i) = tb.Fields("titulo")
                Set i = i + 1
            wend
        end if
    Está me retornando o erro: Erro de tempo de execução do Microsoft VBScript erro '800a0009' Subscrito fora do intervalo Para a linha: Set id(i) = tb.Fields("id") Só que se eu fizer desta maneira
    tb.Open sql, bd     
        if tb.RecordCount>0 then
            Dim i
            Dim id(10,10)
            Dim thumb(10,10)
            Dim titulo(10,10)
            Set i = 1 
            while not tb.EOF
                Set id(i) = tb.Fields("id")
                Set thumb(i) = tb.Fields("tumb")
                Set titulo(i) = tb.Fields("titulo")
                Set i = i + 1
            wend
        end if

    Me retorna o erro:

    Erro de tempo de execução do Microsoft VBScript erro '800a01a8'

    Objeto necessário: '[number: 1]'

    Para a linha:

    Set i = 1

    alguma sugestão???

    Grato desde já...

  8. Ok... A idéia aqui:

    'tumb" & File.FileName & "'

    era fazer com que viesse um tumb antes do nome da imagem... Ex.. se a imagem tem nome Imagem1.jpg, a idéia era transformar ela em tumbImagem1.jpg

    Aqui " & linha & ", " & sublinha & ", o campo linha é número mesmo e não está entre aspas simples...

    Ok. Resolvi este problema (assim: Set linha = Upload.Form("idlinha"))... Agora o problema é outro... Não estou conseguindo fazer com que os campos do tipo texto lá do formulário sejam atribuídos pelas variáveis linha, sublinha, titulo e descrição...

    Já tentei assim: Set linha = Upload.Files("idlinha")

    Assim: Set linha = Upload.Form("idlinha")

    E também por For Each:

    For Each Item in Upload.Form

    Select case Item.Name

    case "idlinha"

    Set linha = Item.Value

    End Select

    Next

    Att...

  9. Obrigado pela ajuda... Consegui resolver, utilizando o componente AspUpload que estava instalado no server... Agora a dúvida é outra... Executando o código abaixo

    <%@ codepage="1252" language="VBScript" %>
    <% response.Charset="ISO-8859-1" %>
    <!--#include file="upload_funcoes.asp"-->
    <!--#include file="functions.asp"-->
    <%    
        Set Upload = Server.CreateObject("Persits.Upload")
        Set Jpeg = Server.CreateObject("Persits.Jpeg")
        
        ' Recuperando os Dados Digitados ----------------------
        Set linha = Upload.Files("linha")
        Set sublinha = Upload.Files("sublinha")
        Set titulo = Upload.Files("titulo")
        Set descricao = Upload.Files("descricao")
            
        Upload.SetMaxSize 50000000, True
        
        Upload.Save("c:\xxx\xxx\xxx\images\produtos")
        
        Set File = Upload.Files("foto")
        
        'For Each File in Upload.Files
        '    File.SaveAs Path & File.FileName
        'Next
        
        ' Open source image
        Jpeg.Open "c:\xxx\xxx\xxx\images\produtos\" & File.FileName
        
        ' New width
        L = 100
        
        ' Resize, preserve aspect ratio
        Jpeg.Width = L
        Jpeg.Height = Jpeg.OriginalHeight * L / Jpeg.OriginalWidth
        
        ' create thumbnail and save it to disk
        Jpeg.Save "c:\xxx\xxx\xxx\images\produtos\tumb" & File.FileName
        
        Set cn = Server.CreateObject("ADODB.Connection")
        cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\xxx\xxx\xxx\databases\bdadmin.mdb;Persist Security Info=False;"
        
        SQL = "INSERT INTO tbprodutos([idlinha], [idsublinha], [titulo], [texto], [foto], [thumb]) VALUES(" & linha & ", " & sublinha & ", '" & titulo & "', '" & descricao & "', '" & File.FileName & "', 'tumb" & File.FileName & "' )"
        Response.Write(SQL)
        Response.End()
        cn.Execute(SQL)
        cn.Close 
        Set cn=nothing
    %>
    <html>
    <head>
    <style>
    body {
        background: #f2f2f2;
        margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
        padding: 0;
        text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
        color: #000000;
        font-family: "Lucida Console";
    }
    </style>
    </head>
    <body>
    <div align="justify" style="width:500px;" id="retorno">
        <h3 align="center">:: Cadastro de Produtos ::</h3>
        <p>Produto '<% Response.Write(titulo) %>' cadastrado com sucesso...</p>
    
    <body>
    </body>
    </html>

    Me retorna o erro:

    Erro de tempo de execução do Microsoft VBScript erro '800a005b'

    A variável de objeto não foi definida

    /admin/bd_Produtos.asp, line 41

    Na linha 41, tenho:

    SQL = "INSERT INTO tbprodutos([idlinha], [idsublinha], [titulo], [texto], [foto], [thumb]) VALUES(" & linha & ", " & sublinha & ", '" & titulo & "', '" & descricao & "', '" & File.FileName & "', 'tumb" & File.FileName & "' )"

    Grato desde já pela ajuda...

    Eduardo Gonçalves

×
×
  • Criar Novo...