Article ID: 196968 - Last Review: March 14, 2005 - Revision: 2.1 PRB: SHAPE Provider Pulls Down All Records in Child TableThis article was previously published under Q196968 On This PageSYMPTOMS
When using a SHAPE statement to retrieve parent and child records, the
SHAPE provider pulls down all child records regardless of whether there is
a matching parent record.
CAUSE
The SHAPE provider relies exclusively on the child statement to determine
which records to return.
RESOLUTION
Modify the child statement to restrict the records returned to match only
those related to the parent records.
STATUS
This behavior is by design.
MORE INFORMATION
The SHAPE provider is a data-provider-neutral service provider. It works by
reading the parent and child records into temporary tables on the local
machine and using the Client Cursor Engine to dynamically filter the child
records according to the value of a field in the current parent record.
Because the provider is data-provider-neutral, it does not know anything about SQL syntax or how the parent and child statements relate to each other in terms of statements sent to the data provider. For example, with the following SHAPE statement: There are two workarounds, which are detailed below. Use a Parameterized SHAPE StatementOne workaround, especially if the parent recordset will just contain a single record, is to use a Parameterized SHAPE statement:Use a JOIN in the Child StatementAnother workaround is to make the child statement more complex so that it reflects any restrictions placed upon the parent statement. This can be accomplished through a JOIN:NOTE: The SQL syntax given above will work with Microsoft SQL Server and Microsoft Jet. Other data providers may require different syntax to accomplish the same goals. REFERENCES
For additional information on SHAPE syntax, please see the following
article in the Microsoft Knowledge Base:
189657
(http://support.microsoft.com/kb/189657/EN-US/
)
HOWTO: Use the ADO SHAPE Command
| Article Translations
|
Back to the top
