Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO recordsets and VFP
Message
From
30/12/2000 09:11:54
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
29/12/2000 11:09:14
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00457793
Message ID:
00458071
Views:
16
>I am using VFP 6 as a front-end to a SQL Server 7 database in a new application, and I have been working with ADO objects for the data access mechanism. After exploring views and SQL Pass-through, these seem to be a bit easier to use for me.
>
> I have created a set of my own data objects as wrappers for the ADO recordsets, and this allows me to do things like validation and business rules before actually changing table data. I haven't thought of a good way to deal with parent-child relationships in the user interface yet, however. I would like to be able to get an ADO recordset (as a child in a relation) into a grid, for example, bound to a parent key, much as SET RELATION works in regular VFP tables. As an alternative, there is a way to load ADO data into an array, which could be used to fill a list box or something. I was just wondering if I am missing anything obvious here. Like any way to bind a grid to something other than a cursor.
>
>Any help would be greatly appreciated, or even a good single-source for ADO object documentation. I got a good head start with an MSDN article called 'ADO jumpstart for VFP developers'

Jim,
I want to reply parts of your question + Vin Miller's.
You can bind ADO recordset to a number of activex controls and MSDataGrid, MSFlexGrid, MSHFlexGrid are the ones grid based. MSFlex and MSHFlexGrid if bound to a recordset it's READONLY. Actually they use recordset just at population time and from there on no binding to recordset. However with some tricks you could trace the position in recordset and do editing with other controls like textboxes (as many like editing outside of grid unlike me:). With hierarchical grid it's really tricky to find corresponding record in recordset (it has a textmatrix array where text is kept and if a row is say 2nd of a parent first array element is empty! It would be nice if it still pointed out to parent's row).
Easiest managable is MSDataGrid. Simply define your recordset either via ADODB or MSADODataControl. ADODC usage is easier if you're going to edit it.
MSHflexGrid OTOH has capabilities beyond native VFP grid < s >. You can use shape commands with ADO and do computations on the fly which we native Foxers need more than one SQL to get that (astonishing since ADO itself is a Fox technology).
I would like to give samples here but I don't think it would be appropriate to waste bandwidth with lengthy posting. I already posted a series of them in different threads. More a good sampling would be as long as 'ADO Jumpstart ..' article :) BTW it was my starting point. Thanks to JVP. When I have time I could assemble a series of samples and send to files section I hope.
Now documentation about ADO is located in more than one central place really. The one concentrating directly on ADO is ADO210.chm I think (ADO2XX.chm more appropriate). It's located in MSDN directory (under folder 1033).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform