Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP/SQL Server or VB/SQL Server, which better combinatio
Message
 
 
To
14/05/1998 10:14:27
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00098662
Message ID:
00099441
Views:
33
Hi Bob...

>>Hmm... I wonder if remote views suck, why MS is adding them to VB 6.. albeit called a DataShape.

Comparing remote views in VFP to the datashape provider in ADO is like comparing apples and oranges. Have you worked with ADO and the datashape provider? I have. Somehow, I don't think you have as the comparison does not work.

What does the DataShape Provider do?

Well.. The use is primarly for creating hierachical recordsets - the abilty to see child records of a parent without having to run SQL. The DataShape Provider literally takes a result set and shapes it into a recordset that can support the drilling down The MS Hierachical FlexGrid Control is the tool available to display these kinds of recordsets. The control is kind of a hybrid between the treeview and the grid.

That said, how does a remote view in VFP compare to this.

Let me continue with some code. If you have ADO 2 - you can get this by getting the VI 6 preview - and you have a DSN pointing to the access northwind database - you can do this stuff:

rst = Createobject("adodb.recordset")
cnn = createobject("adodb.connection")
cnn.Provider = "MSDataShape"
cnn.open("northwind")
rst.Open("SHAPE {SELECT * FROM Customers} AS Customers " + ;
"APPEND (( SHAPE {SELECT * FROM Orders} AS Orders " + ;
"APPEND ({SELECT * FROM OrderDetails} AS OrderDetails " + ;
"RELATE OrderID TO OrderID) AS OrderDetails) " + ;
"RELATE CustomerID TO CustomerID)", cnn)

As we can see here, customers are bing selected. For each customer , order records are selected. For each order record, order details are being selected.
So, how does a hierachical recordset work. Well, the last field in the rst recordset is named orders. Is it a field? Sort of. If you issue this code:

orders = rst.fields("orders").value

you can then do this?

?orders.fields.count
?orders.fields("orderid").value && and so forth.

See how we are drilling down here. Lets continue..

The last field in orders is.... you guessed it... orderdetails. So....

orderdetails = orders.fields("orderdetails").value

?orderdetails.fields.count
?orderdetails.fields("productid").value

My argument with remote views in VFP - is that they are a lousy wrapper for SPT. There are loads of problems - and the most stable way I have found to do things is with SPT.

As far as the the DataShape Provider having any relation to VFP remote views - I don't see your point...<s>
Previous
Reply
Map
View

Click here to load this message in the networking platform