General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only