Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AutoInc value and CA
Message
De
13/02/2007 20:31:59
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01191628
Message ID:
01195407
Vues:
23
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

I have a property called "AutoIncValue" defined in my Base CA Class, I set it to .t. when using it with a table which has an AutoInc field.

In the Init of my base class I call the Setup() Method of the class which handles getting the AutoInc Value.
*-- Init()
This.Setup()
*--Setup()
If This.AutoIncValue then
	If Empty(This.InsertCmdRefreshCmd) then
		If Empty(This.InsertCmdRefreshKeyFieldList) then
			This.InsertCmdRefreshKeyFieldList = This.KeyFieldList
		Endif
		If Empty(This.InsertCmdRefreshFieldList) then
			This.InsertCmdRefreshFieldList = This.InsertCmdRefreshKeyFieldList
		Endif
		This.InsertCmdRefreshCmd = "select " + This.InsertCmdRefreshKeyFieldList + " from " + This.Tables + " where " + This.InsertCmdRefreshKeyFieldList + " = GetAutoIncValue() "
	Endif
Endif
If you need more info. let me know.

Sarosh
>Hi everybody,
>
>I have a table with an AutoInc field. I have a CA for this table. I start a form in a New mode, so my field is empty. I show "New" in the textbox for the ID field. However, when I save my record, I want to show the actual ID. Should I do CursorRefresh() then or how can I get the actual ID after I saved the record?
>
>BTW, my parameter variable may not be in scope at this time.
>
>Thanks a lot in advance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform