Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AutoInc value and CA
Message
From
13/02/2007 20:31:59
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01191628
Message ID:
01195407
Views:
22
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform