Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter
Message
From
08/03/2007 18:59:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
CursorAdapter
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01202151
Message ID:
01202151
Views:
56
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
Next
Reply
Map
View

Click here to load this message in the networking platform