Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ANN: New VFP OLEDB data provider
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
ANN: New VFP OLEDB data provider
Miscellaneous
Thread ID:
00675524
Message ID:
00675524
Views:
59
OLEDB library for VFP v.0.9 (file #10002) now includes a Data Source object which provides read-write access to data in any opened cursor in VFP application.

DSObject can be created only within a VFP application and can be used as a Data Source for a data bound ActiveX controls or as OLEDB data provider.

DSObject, in contract to VFP 7.0 OLEDB Provider:
- Provides connection to opened cursor (table, query, view, remote view), not a file. This makes possible to use all VFP features (sorting, filtering etc.) for preparing data.
- Makes possible using of data bound ActiveX controls for editing of native VFP data without ADO objects.
- Can be used with VFP 6.0 applications.

DSObject, compared with CursorToRs methods:
- Creates a connected, updatable recordset.
- Can be used with large data sets without loss of time on data conversion.

Notes:
- DSObject creates a keyset server-side cursor. All changes in record sequence made in VFP code (adding and deleting records, SET ORDER, SET FILTER etc.), will not be automatically reflected in data source.
- There is no notification from VFP side to data source when data changed. However changed data will be visible in data source.
- DSObject can be created only within a VFP application. However you can create a recordset in VFP and pass it to another application.
- When used as OLEDB provider DSObject has limitations of OLEDB Simple Provider. It doesn't support a command capability and cannot be used with client-side cursors.
- When used as OLEDB provider DSObject is created indirectly and OleDbFox library is not properly initialized. To avoid this problem you have to create any other object from this library before connecting to provider.

How to connect DSObject to data bound ActiveX control:
USE employee IN 0
ds = CreateObject("OleDbFox.DSObject")
da = CreateObject("DBADAPT.DataAdapter") && Microsoft Data Adapter
da.Object = ds

This.OleDataGrid.DataMember = "employee" && Alias of the table
This.OleDataGrid.DataSource = da
How to use DSObject as OLEDB provider:
* Initializing the OleDbFox library
o = CreateObject("OleDbFox.Utils")

USE employee IN 0
oRS = CreateObject("ADODB.Recordset")
oRS.ActiveConnection = "Provider=MSDAOSP;Data Source=OleDbFox.DSObject;"
oRS.Open("employee") && Alias of the table
In "DSO Samples" directory there are a samples of connecting MS DataGrid, DataList, DataCombo and VS FlexGrid to VFP data. (Trial version of VideoSoft FlexGrid 7.0 can be downloaded from www.ComponentOne.com or www.componentsource.com)

This object is "fresh-baked", so any comments (positive or negative), ideas, bug reports etc. are very welcome.

Other news. OLEDB library now supports Variant data type and can be connected to ISAM datasources (Text, Excel etc.) and OLEDB Simple Providers (XMLDOM).
Reply
Map
View

Click here to load this message in the networking platform