Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to ALIAS a CA the same as its VFP table?
Message
From
03/12/2006 19:30:49
 
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01174105
Message ID:
01174520
Views:
11
Yes, there is a way.
CLEAR
SET MULTILOCKS ON 

CREATE TABLE testCAAlias (f1 I, f2 I)
INSERT INTO testCAAlias values(1,1)
INSERT INTO testCAAlias values(2,2)

USE

USE testCAAlias ALIAS SomeOtherAlias IN 0

LOCAL oCA as CursorAdapter
oCA=CREATEOBJECT("CursorAdapter")

oCA.DataSourceType="NATIVE"
oCA.SelectCmd="select * from SomeOtherAlias"
oCA.Tables="SomeOtherAlias"
oCA.KeyFieldList="f1"
oCA.UpdatableFieldList="f1,f2"
oCA.UpdateNameList="f1 SomeOtherAlias.f1, f2 SomeOtherAlias.f2"
oCA.BufferModeOverride= 5 

oCA.Alias = "testCAAlias"

?oCA.CursorFill()
SELECT testCAAlias

INSERT INTO testCAAlias VALUES (3,3)
DELETE FROM testCAAlias WHERE f1=2
UPDATE testCAAlias SET f2 =11 WHERE f1=1

SELECT SomeOtherAlias 
?ALIAS()
LIST

SELECT testCAAlias 
?ALIAS()
LIST

?TABLEUPDATE(.T.)

SELECT SomeOtherAlias 
?ALIAS()
LIST

CLOSE TABLES all
USE testCAAlias 
LIST
Thanks,
Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform