Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2006
    Messaggi
    121

    Esclusione campi da query

    Salve
    Come faccio ad eliminare dalla query alcuni campi senza rimuoverli fisicamente dal database?

    Ho visto degli esempi in giro ma nessuno sembra adattabile al mio codice che è il seguente:

    <%
    u_input = trim(request.form("u_input")) 'u_input is the varible for user input
    u_input= replace(u_input, "'", "''")

    ' the trim function removes any blanks around the the use input
    u_field=request.form("u_field") 'the dropdown varible for user inputted search field

    if u_input <> "" then ' If the user entered a value query the db
    accessdb="_ArchivioProgrammi.mdb" ' name of the access db
    query_name="ArchivioQ" ' name of the table within the access db
    cn="driver={microsoft access driver (*.mdb)};"
    cn=cn & "dbq=" & server.mappath(accessdb)
    set rs = server.createobject("ADODB.Recordset")
    sql = "select * from "& query_name &" where " & u_field & " like '%%" & u_input & "%%' "

    qualcuno sa aiutarmi, preciso che il SELECT viene fatto direttamente da query access e non da una tabella, ma forse non interessa ed è la stessa cosa.
    grazie
    ciao

  2. #2
    rimuovere da una query? vuoi dire: nella tabella ho nome, cognome, indirizzo; mi interessano solo nome e cognome. è così?

  3. #3
    Utente di HTML.it
    Registrato dal
    Oct 2006
    Messaggi
    121

    SI

    SI proprio quello

  4. #4
    UODATE tabella SET campo_inutile = '-' WHERE campo_utile = 'valore'

  5. #5
    Utente di HTML.it
    Registrato dal
    Oct 2006
    Messaggi
    121

    re

    Grazie

  6. #6
    Originariamente inviato da lukeonweb
    UODATE tabella SET campo_inutile = '-' WHERE campo_utile = 'valore'

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.