4 |
The LA Fox Developer Newsletter
June
2000
ADO
Jumpstart
(Con’t from page 3)
Categories RELATE ‘CategorylD’ TO ‘CategorytD’) AS
categories,((SELECT
*
FROM “dbo”.”Suppllers”} AS Suppliers
RELATE ‘SupplierlD’ TO ‘SupplieriD’) AS Suppliers) AS Products
RELATE ‘ProductiD’ TO ‘ProductiD’) AS Products) AS OrderDetails
RELATE ‘OrderiD’ TO ‘OrderiD’) AS OrderDetails,(( SHAPE (SELECT
*
FROM “dbo”.”Emptoyees”} AS Employees APPEND
((
SHAPE
(SELECT
*
FROM “dbo”.”EmployeeTerritories”} AS
Employee Territories APPEND
((
SHAPE (SELECT
*
FROM
“dbo”.”Territories”) AS Territories APPEND ((SELECT
*
FROM
“dbo”.”Region”} AS Region RELATE ‘RegioniD’ TO ‘RegioniD’) AS
Region) AS Territories RELATE ‘TerritorylD’ TO ‘TerritorylD’) AS
Territories) AS EmployeeTerritories RELATE ‘EmployeelD’ TO
‘EmployeelD’) AS EmployeeTerritories) AS Employees RELATE
‘EmployeelD’ TO ‘EmployeelD’) AS Employees,((SELECT
*
FROM
“dbo”.”Shippers”) AS Shippers RELATE ‘ShipVia’ TO ‘ShipperlD’) AS
Shippers) AS Orders RELATE ‘CustomerlD’ TO ‘CustomerlD’) AS
Orders
This is just about as complicated as it gets. Nobody in their
right mind would want to hammer this code out manually.
Fortunately, there is a visual way to build this code. The
DataEnvironment designer that ships with Visual Basic allows
you to visually design ADO connections, recordsets, and
hierarchical recordsets. The following illustrates how this
hierarchical recordset appears in the designer:
The extensive Shape syntax can be copied and pasted into
Visual FoxPro, or any other environment that can host ADO.
For complete details on how to use the DataEnvironment
designer, consult the Visual Basic documentation on the MSDN
CDs that ship with Visual Studio.
The following Visual FoxPro code traverses the hierarchical
recordset and displays the data:
#lnclude adovfp.h
oRecordset
=
createObject(”adodb.recordset”)
oConnection
=
CreateObject(”adodb.connection”)
(Con’t, page
5)
Undocumented
(Con’t from page 3)
CHANGEO
I believe this function was used as part of dBaselV’s transaction
system. This function determines whether or not a record had
Changed or is a “dirty” record. Returns a .F. in VFP. This is
documented in the latest HackersGuide...
COMPLETED()
This function is for compatibility with dBaselV. dBaselV prob-
ably used it for the same purpose for which we use the
TABLEUPDATEO function. This function returns a .F. in VFP.
This is documented in the latest HackersGuide...
FIXED(number)
This function is for compatibility with dBaselV. What it does, I
don’t know nor remember. There is
actually error checking for
this command. Enter FIXEDO without a parameter and VFP will
disallow it. Pass it some sort of number and VFP promptly
returns it.
I don’t see much value in that...
FLOAT(number)
This function is for compatibility with dBaselV. What it does, I
don’t know nor remember. There is actually error checking for
this command. Enter FLOAT() without a parameter and VFP will
disallow it. Pass it some sort of number and VFP promptly
returns it. I don’t see much value in that...
ID()
This is supposed to return the same thing as SYS(O). If I
remember correctly, this function came in as part of the addi-
tional Foxpro 2.6 command set,
trying to be more compatibile
with dBase. That’s how we got
PCOUNTO, which is a better
function than PARAMETERSO. Anyway, the HackersGuide
goes into some
detail
with this command and states that on
some machines
that the SYS(O)
is not returned.
ISMARKED()
This function now returns an error in VFP. Foxpro used to
accept this function and not generate an error. For some
reason, the developers of VFP made
it a point to take this
command out of the keyword set. Why
I don’t know. This is
documented in the latest HackersGuide...
LKSYSO
This function now returns an error in VFP. Foxpro used to
accept this function and not generate an error. Since VFP is
less usable than FoxPro 2.6 for converting old dBase IV pro-
grams this function has been taken out of the keyword set. It’s
an unsupported dBase IV function that is used in dBase IV
to
query information about who locked a record, since what time
it
has been locked, etc. in dBase IV this function is not Y2K-
compliant. In fact,
Foxpro used to generate an error if you didn’t
pass the right amount of arguments. But when you passed one
number to the Lksys function,
it returned “Function Not Imple-
mented.”
This was documented in the latest HackersGuide.
(Con’t, page 5)
Page 4
|
4 |