Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2005
    Messaggi
    22

    Informazioni du "ORDER BY"

    Salve ragazzi, ecco la parte di codice che vorrei analizzare con voi:

    strFile = "pannello.asp"
    strTable = "Nomi"
    strKey = "ID" contatore
    bgHeaderColor = "#990000"
    fontHeaderColor = "white"
    bgColor1 = "Silver"
    fontColor1 = "Black"
    bgColor2 = "White"
    fontColor2 = "Black"


    Set MyConn=Server.CreateObject("ADODB.Connection")
    MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("/mdb-database/database2.mdb")



    Select Case Request("mode")
    Case "AddItem"
    AddItem
    Case "AddItemAction"
    AddItemAction
    Case "EditItem"
    EditItem
    Case "EditItemAction"
    EditItemAction
    Case "DelItem"
    delItem
    Case Else
    ShowAll
    End Select





    Sub ShowAll()

    MySQL="Select * from " & strTable
    Set MyRs=MyConn.Execute(MySQL)

    Ora nella tabella "Nomi" del db c'è un campo "Espansione".
    Vorrei ordinare i risultati secondo questo campo, il codice dovrebbe essere:

    MySQL="Select * from " & strTable order by Espansione DESC
    giusto? A me non funge e da errore
    Dove sbaglio?
    Grazie a tutti

  2. #2
    codice:
    MySQL="SELECT * FROM "& strTable &" ORDER BY Espansione DESC"
    prova un po'così a vedere se va

    You see beauty I see pain, You see sky and I see acid rain

  3. #3
    Utente di HTML.it
    Registrato dal
    Apr 2005
    Messaggi
    22
    funziona grazie!

  4. #4
    di niente

    You see beauty I see pain, You see sky and I see acid rain

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.