Hello,

Can anyone tell me why cursorgetprop("KeyFieldList") is not returning
the primary key field of my cursoradapter?

When referencing the cursoradapter object in code, the field name is
there. E.g.

thisform.dataenvironment.cursoradapter1.keyfieldlist

Re: CursorAdapter - cursorgetprop("KeyFieldList") ? by Cindy

Cindy
Thu Feb 09 20:34:46 CST 2006

Hi,

You haven't given much to go on. Please describe your data and post relevant
code such as the Select statement, etc. Also describe the back end database.
Is it native Fox tables, MS SQL Server, or what?

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


<drsystems@gmail.com> wrote in message
news:1139509476.127693.100150@g43g2000cwa.googlegroups.com...

> Can anyone tell me why cursorgetprop("KeyFieldList") is not returning
> the primary key field of my cursoradapter?



Re: CursorAdapter - cursorgetprop("KeyFieldList") ? by Christian

Christian
Thu Feb 09 23:40:11 CST 2006

Hi,

they are not the same.

the properties of the Cursor (get & set with CURSORGET(SET)PROP) and the
properties of the CursorAdapter are unrelated.

That is if you change one of them the other is untouched.

If the cursor is attached to a CursorAdapter most of the properties you
can query with CURSORGETPROP have no effect on the Cursor cause the
CursorAdapter properties have precedence.

If you have a look in help file you find this:

"Setting UpdatableFieldList for CursorAdapter objects overrides the
property setting of a cursor when attached to a CursorAdapter object.
That is, changing the settings on the cursor using CURSORSETPROP() has
no effect."

and similar comments on almost all Cursor properties.

Since you're using Cursoradapter just completly forget about CURSORGETPROP.

If you only have the cursorname at hand you may use something like this:

LOCAL loCA
loCA = GETCURSORADAPTER('yourAlias')
?loCA.KeyFieldList

Regards
Christian

Re: CursorAdapter - cursorgetprop("KeyFieldList") ? by drsystems

drsystems
Fri Feb 10 10:09:23 CST 2006

Perfect!
I wasn't aware of the API 'GetCursorAdapter'.
I was thinking the only way to get the 'KeyFieldList' or 'Tables'
property would be to reference the CursorAdapter by object reference.
'GetCursorAdapter' is the way to go.

BTW, the CursorAdapter was connecting to a SQL 2005 via ODBC connection
string.