Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record Pointer Moving after REQUERY
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00290073
Message ID:
00290255
Vues:
27
>Bob,
>
>Thanks I just needed to be slapped! Well, I was trying to get the ID value that was generated by my Stored Procedure code back into my View record.
>
>It doesn't retrieve it from the Refresh(). So I was doing a Requery() as well but retrieves all records again since currently I am pulling in all records for Local Views for single table edits. I am contemplating one record for the future but I will have to change all of my navigation code to support it in my forms.
>
>How should I get back my new ID that was generated?
>
>TIA

Well, if your stored procedure is generating the ID, then you can get the ID from the SP, then put it into the view.

If you are using identity columns you can query the @@IDENTITY varible.

Is your SP a default value for you column? You might want to do something like...
nConn = CursorGetProp('Connection')
ID = null
nResult = SQLExec(nConn, "sp_NEWID 'TABLE' ?@ID")
replace MyView.ID with ID
tableupdate()
BOb
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform