Visualizzazione dei risultati da 1 a 9 su 9
  1. #1
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560

    errori... Expected end of statement

    ho trovato questo scritp in rete:

    codice:
    <%@LANGUAGE = JScript%>
    <%
       var Cn = new ActiveXObject("ADODB.Connection");
       var Sc = "driver={Microsoft Access Driver (*.mdb)};dbq=" + Server.MapPath("db.mdb");
           Cn.Open(Sc);
       var Sql = "SELECT * FROM dati ORDER BY id DESC";
       var Mostra = new ActiveXObject("ADODB.Recordset");
           Mostra.Open(Sql,Cn,1);
       var pag = parseInt(Request.QueryString("id"));
           if (isNaN(pag) || pag < 1) pag = 1;
           if (!Mostra.EOF) {
                Mostra.PageSize = 10;
                Mostra.AbsolutePage = pag;
           }
       var i = 0;
    %>
    <html>
     <head>
      <title>Paginazione per grandi query</title>
     </head>
    <body>
    
    <%while (!Mostra.EOF && i<10) {%>
    <table width="100%" border="1">
     <tr>
       <td><%=Mostra("campo")%></td>
     </tr>
    </table>
    
    <%
             i++;
          Mostra.MoveNext();
       }
    %>
    
    <table width="100%">
     <tr>
       <td width="50%">
          <%if (pag > 1) {%>Precedenti<%}%>
          <%else {%>Precedenti<%}%>
       </td>
       <td width="50%" align="right">
          <%if (!Mostra.EOF) {%>Successivi<%}%>
          <%else {%>Successivi<%}%>
       </td>
     </tr>
    </table>
    
    </body>
    </html>
    <%Cn.Close()%>

    mi genera questo errore:

    Microsoft VBScript compilation error '800a0401'

    Expected end of statement

    /include/inc_news.asp, line 2

    var Cn = new ActiveXObject("ADODB.Connection");

    e po di seguito altri..come mai?

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Se la pagina è solo questa non dovresti avere problemi...
    Ma io temo tu l'abbia inclusa da un'altra... e questa è in JScript non VBScript.

    Roby

  3. #3
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    ora sto provando a farlo funzionare aprendo la pagina da sola...

    mi da questo errore:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

    ODBC driver does not support the requested properties.

    /news.asp, line 8


    riga 8: Mostra.Open(Sql,Cn,1);

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    Mostra.Open(Sql,Cn);
    Roby

  5. #5
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

    [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'dati'. Make sure it exists and that its name is spelled correctly.

    /news.asp, line 8





    sfido me stesso...ci riuscirò?? non posso mettermi a studiare asp..ci vorrebbe molto ma molto tempo

  6. #6
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Beh così di sicuro non potrai continuare ancora a lungo...
    L'errore dice che la tabella di nome "dati" nel tuo db non esiste!

    Roby

  7. #7
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    piano piano con qualche aiutino ci riesco dai...


    ADODB.Recordset error '800a0cb3'

    Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.

    /news.asp, line 13


    riga 13: Mostra.AbsolutePage = pag;

  8. #8
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    Recordset corrente non sostiene i bookmarks. Ciò può essere una limitazione del fornitore o del cursortype selezionato.

    ???????????????

  9. #9
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    up

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.