Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    problema ASP-Access-Query

    salve,
    vorrei eseguire una select su 2 tabelle contemporaneamente, ho tentato di farlo in questo modo e purtroppo mi restituisce un errore..
    incollo il codice:

    <%

    SQL="Select * FROM sub_cat LEFT JOIN catLinks ON sub_cat.cat_id=catLinks.id"
    set mostra=conn.execute(SQL)
    while not mostra.eof%>
    <%=mostra("sub_cat.id")%>
    <%=mostra("catLinks.name_cat")%>
    <%=mostra("sub_cat.name_scat")%>
    <%
    mostra.movenext
    wend
    set mostra=nothing
    %>
    ERRORE:


    ADODB.Recordset error '800a0cc1'

    Item cannot be found in the collection corresponding to the requested name or ordinal.

    Nel db le due tabelle ed i relativi campi esistono, cat_id e id sono entrambi numerici

    cosa potrebbe essere???

    grazie
    Empirestate.it - La grande mela arriva in Italia
    sempre voluto sapere sulla grande mela, forum, articoli e molto altro ancora

    www.empirestate.it

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    set mostra=conn.execute(SQL)
    if not mostra.EOF then
    while not mostra.eof%>
    ...
    ...
    wend
    end if

    Roby

  3. #3
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Probabile sia questo a non funzionare.

    <%=mostra("sub_cat.id")%>

    prova a dichiarare i campi nella select

    Roby

  4. #4
    SQL="Select sub_cat.id, sub_cat.name_scat,catLinks.id,catLinks.name_cat FROM sub_cat LEFT JOIN catLinks ON sub_cat.cat_id=catLinks.id"

    dici di provare cosi?

    ora vedo se va e ti faccio sapere
    Empirestate.it - La grande mela arriva in Italia
    sempre voluto sapere sulla grande mela, forum, articoli e molto altro ancora

    www.empirestate.it

  5. #5
    sempre stesso errore

    ADODB.Recordset error '800a0cc1'

    Item cannot be found in the collection corresponding to the requested name or ordinal.

    /admin/ins_links.asp, line 34

    la riga 34 è proprio <%=mostra("sub_cat.id")%>
    Empirestate.it - La grande mela arriva in Italia
    sempre voluto sapere sulla grande mela, forum, articoli e molto altro ancora

    www.empirestate.it

  6. #6
    perfetto grazie mille ho risolto così:

    SQL="Select sub_cat.id AS idsub, sub_cat.name_scat AS namescat,catLinks.id AS idcat ,catLinks.name_cat AS namecat FROM sub_cat LEFT JOIN catLinks ON sub_cat.cat_id=catLinks.id"
    Empirestate.it - La grande mela arriva in Italia
    sempre voluto sapere sulla grande mela, forum, articoli e molto altro ancora

    www.empirestate.it

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.