Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di B-Side
    Registrato dal
    Sep 2004
    Messaggi
    11

    [C++] Recuperare id ultimo record inserito

    Ciao a tutti,
    il mio problema è che devo recuperare l'id dell'ultimo record inserito sto usando questo sistema:

    codice:
     ADODataSet->Insert();
     ADODataSet->FieldByName("Nome")->AsInteger = "pippo";
     ADODataSet->FieldByName("Data")->AsDateTime = Now();
     ID = ADODataSet->FieldByName("ID")->AsString;
     ADODataSet->UpdateStatus();
    ma non sembra funzionare...
    Qualcuno sa come potrei fare?

    Grazie in anticipo
    We are the damned of all the world / With saddness in our hearts / The wounded of the wars / We've been hung out to dry / You didn't want us anyway / And now we're making up our minds / You tell us how to run our lives / We run for youthanasia

  2. #2
    Utente di HTML.it L'avatar di B-Side
    Registrato dal
    Sep 2004
    Messaggi
    11
    Risolto, grazie.
    dovevo usare Post() al posto di UpdateStatus() e spostare dopo il Post() l'assegnazione a ID.


    Ciao ciao
    We are the damned of all the world / With saddness in our hearts / The wounded of the wars / We've been hung out to dry / You didn't want us anyway / And now we're making up our minds / You tell us how to run our lives / We run for youthanasia

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.