Non è forse possibile?codice:strSql = "SELECT * FROM " & tabella & " WHERE idPst = (SELECT @@IDENTITY FROM " & tabella & " )"
Non ricevo errori ma va in end of file.
Thx!
Non è forse possibile?codice:strSql = "SELECT * FROM " & tabella & " WHERE idPst = (SELECT @@IDENTITY FROM " & tabella & " )"
Non ricevo errori ma va in end of file.
Thx!
"If a record is inserted through the user interface, either with datasheets, forms, or SQL statements in the Access SQL View window, the @@IDENTITY variable will return 0. For this reason, the value of @@IDENTITY is only accurate immediately after adding a record from code."
Praticamente se attraverso due funzioni distinte e successive, con la prima inserisco il record poi, con la seconda uso @@IDENTITY, ottengo il risultato positivamente (quindi potrei fare una terza query che mi estrae i dati)
... se invece con la prima funzione inserisco il record e con la seconda tento l'estrazione dei dati usando @@IDENTITY nella subquery, la stessa restituisce 0 e va in end of file.
Se assemblo tutto in una unica funzione, la subquery con @@IDENTITY funziona.
... drammatico. Fortuna che access si utilizza una volta ogni morte di papa.
Saluti.
P.s.
tutto questo per analizzare le eccezioni che potrebbero verificarsi ad ogni singolo passaggio![]()