Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SendUpdates - why I can not use it?
Message
From
19/06/2009 16:27:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01406736
Message ID:
01407299
Views:
47
>>>>>TABLEUPDATE() :-)))))
>>>>>
>>>>>Like its sang in "Porgy and Bess" "It's summer time and the livin' is easy ...."
>>>>
>>>>Yes, thanks figured this out. I was doing .NET recently and thus somehow expected CA to have a method to pass my changes, something like AcceptChanges()
>>>
>>>You could make your own :-) in your CA base class.
>>
>>Just wondering... if VFP knows that a CA has an attached alias, and coordinates tableupdate() with the CA... what if there are two CA objects attached to the same alias? Would this produce an error, or would Fox get confused or...? Is there any knowledge about this issue lying around?
>
>Yes, the error "Alias already in use" will raise :-)

Not two CA's creating the same cursor - the second would close the first one's. More like this:
LOCAL ca1 as CursorAdapter, ca2 as CursorAdapter
CREATE CURSOR crs1 (l l)

ca1=CREATEOBJECT("ca")
ca2=CREATEOBJECT("ca")

ca1.CursorAttach("crs1")
ca2.CursorAttach("crs1")

INSERT INTO crs1 VALUES (.f.)
?TABLEUPDATE(1,.f.,"crs1", a)


DEFINE CLASS ca as CursorAdapter

PROCEDURE AfterInsert
?this.Name, PROGRAM()

ENDDEFINE 
The second one simply doesn't attach. Its alias remains empty. Seems that Fox maintains a pointer to the CA somewhere in the alias, and if it already has an adapter in the current DS, it won't attach another - but won't cause an error either.

And the AfterInsert() doesn't fire at all... which I didn't expect.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform