>>*The CursorFill() method is part of the PEMs of this new baseclass. Everytime it´s called, it will use the SelectCmd property to get the data and fill the cursor. We could use the class above like this: >>PUBLIC oCustomersData >>oCustomersData = CreateObject("CustomersData") >> >>BROWSE nowait >> >> >> >>*The CursorAdapter new class gives us new opportunities to extend our data cursors, it helps us to work with local and remote data, from Native VFP data to ODBC, ADO and XML. >> >>*Its use is pretty straight-forward. Take a look at the next sample. We start by defining a new class, based on the CursorAdapter baseclass: >> >>Define CLASS CustomersData as CursorAdapter >> >> *-- Let´s define the DataSourceType as "Native" (VFP data) >> DataSourceType="Native" >> >> *-- Let´s define the name of the alias that should be created. >> Alias="curCustomers" >> >> *-- Let´s define the command that will generate the data to fill the cursor. >> SelectCmd = "select * from Customer" >> >> Procedure Init >> *-- Once the object is created, let´s fill the cursor. >> this.CursorFill() >> EndProc >>EndDefine >> >> >>*Remember: once the object is created, there will be a curCustomers cursor opened at the browse. >> >>*Do you want a little more fun? Well, let´s take a look at this sample: >> >>Define CLASS CustomersData as CursorAdapter >> >> *-- Now, we want to define the type of the data source as ODBC >> DataSourceType="ODBC" >> >> Alias="curCustomers" >> >> *-- We can define a "Cursor Schema" >> CursorSchema = ; >> "customerid c(5),companyname c(30),contactname c(30),"+; >> " contacttitle c(30), address c(30), city c(30), country"+; >> " c(30)" >> >> SelectCmd = ; >> "select customerid, companyname, contactname, "+; >> " contacttitle, address, city, country from Customers" >> >> >> >> >> *-- Remember the CursorSetProp() function? :) >> Tables = "Customers" >> KeyFieldList = "customerid" >> UpdatableFieldList = "companyname" >> UpdateNameList = "companyname,curcustomers.companyname customers.companyname" >> >> Procedure Init >> >> *-- Add a property at run-time that holds a Connection Handle. >> This.AddProperty('Connection',; >> SQLSTRINGCONNECT(; >> "Driver=SQL Server;Server=TE-13716\DEVTEST;"+; >> "Description=Northwind, Int Security;"+; >> "DATABASE=Northwind")) >> >> *-- The data source is our Connection Handle >> This.DataSource = This.Connection >> >> This.CursorFill() >> >> EndProc >>EndDefine >>>