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

    funzione crealistbox errore

    questa la funzione
    codice:
    '---Funzione Crea ListBox
    function Crea_Listbox(Campo_Valore, Campo_Nome, Tabella, Nome_listbox)
    Temp="<select name='"&Nome_listbox&"' class='caselladitesto'>" & chr(10)
    Temp=Temp & "<option value=''></option>" & chr(10)
    sql="select "&Campo_Valore&", "&Campo_Nome&" from "&Tabella&" "
    Set rs = Cnn.Execute(sql)
    do while not rs.eof
    Temp=Temp & "<option value='" & RS(Campo_Valore) & "'>" & left(lcase(RS(Campo_Nome)),17) & "</option>" & chr(10)
    rs.movenext
    loop
    rs.close
    set rs=nothing
    Temp=Temp & "</select>"
    Crea_Listbox=Temp
    end function
    questo l'errore che ricevo
    passando come campo_valore tariffa
    campo_nome NStato
    tabella Nazioni
    nome_listbox Stati
    codice:
    Microsoft JET Database Engine error '80040e14'
    
    The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
    
    /ecomm/include/inc_function.asp, line 139
    questa la linea 139
    sql="select "&Campo_Valore&", "&Campo_Nome&" from "&Tabella&" "
    Set rs = Cnn.Execute(sql) <------

  2. #2
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135
    E l'errore?

  3. #3
    Microsoft JET Database Engine error '80040e14'

    The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.

    /ecomm/include/inc_function.asp, line 139

  4. #4
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135
    L'errore mi pare chiaro:

    Stai cercando di chiamare qualcosa all'interno della tua query con un nome riservato alle procedure ASP o ACCESS.

    Scrivi così:
    codice:
    sql="select "&Campo_Valore&", "&Campo_Nome&" from "&Tabella&" " 
    response.write sql:response.end
    Set rs = Cnn.Execute(sql)
    e posta cosa visualizzi sul browser.

  5. #5
    risolto.....

    passavo come valore di select la virgola quindi dava errore.

    cioè come se il campo della tabella da leggere si chiamasse [,].

    grazie.... era così visibile che passava inosservato!

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 © 2025 vBulletin Solutions, Inc. All rights reserved.