Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter
Message
De
08/03/2007 18:59:17
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
CursorAdapter
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01202151
Message ID:
01202151
Vues:
59
I've put this code in the Init() of a form that has a grid on it. The form has nothing else. It doesn't have any more code elsewhere.
And the question is: why can't I have a cursor in my grid with this code??
Thanks
Hernan


LOCAL cSelectCmd AS String, cSchema AS String, cUFL AS String, cUNL AS Strings

cSelectCmd = "SELECT Padres.padreid, Padres.c1 FROM Padres"

TEXT TO cSchema NOSHOW PRETEXT 15
padreid i,
c1 c(9)
ENDTEXT

TEXT TO cUFL NOSHOW PRETEXT 15
padreid,
c1
ENDTEXT

TEXT TO cUNL NOSHOW PRETEXT 15
padreid Padres.padreid,
c1 Padres.c1
ENDTEXT

cSchema = CHRTRAN( cSchema, CHR(13) + CHR(10), " " )
cUFL = CHRTRAN( cUFL, CHR(13) + CHR(10), " " )
cUNL = CHRTRAN( cUNL, CHR(13) + CHR(10), " " )

THISFORM.AddProperty("caPadres")

Thisform.caPadres = CREATEOBJECT('cursoradapter')

WITH thisform.caPadres
.Alias = "curPadres"
.BufferModeOverride = 5
.CursorSchema = cSchema
.DataSourceType = "NATIVE"
.KeyFieldList = "Padreid"
.SelectCmd = cSelectCmd
.SendUpdates = .T.
.Tables = "Padres"
.UpdatableFieldList = cUFL
.UpdateNameList = cUNL
.UseTransactions = .T.
.CursorFill(.T., .F.)
ENDWITH

SELECT curPadres

thisform.grid1.RecordSource = "curPadres"
thisform.grid1.Refresh
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform