Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to ALIAS a CA the same as its VFP table?
Message
De
03/12/2006 19:30:49
 
 
À
01/12/2006 10:50:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Divers
Thread ID:
01174105
Message ID:
01174520
Vues:
13
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform