Microsoft KB Archive/250999

= PRB: RDS Does Not Work Correctly with OLE DB Simple Provider =

Article ID: 250999

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Data Access Components 1.5
 * Microsoft Data Access Components 2.0
 * Microsoft Data Access Components 2.1
 * Microsoft Data Access Components 2.5
 * Microsoft Data Access Components 2.6
 * Microsoft Data Access Components 2.7
 * OLE DB Simple Provider Toolkit 2.0
 * OLE DB Simple Provider Toolkit 2.0

-



This article was previously published under Q250999



SYMPTOMS
When the Remote Data Service (RDS) for ActiveX Data Objects (ADO) is used with an OLE DB provider that was built by using the OLE DB Simple Provider (OSP) Toolkit, the following error message may occur:

0x80004005 (Unspecified error)

The error message occurs when you use the RDSServer.DataFactory Query method or when you return the disconnected recordset from a business object.



CAUSE
An OLE DB provider that is built with the OLE DB Simple Provider (OSP) Toolkit can only return rowsets that contain the VARIANT type data. RDS cannot remotely marshal the VARIANT type data.



RESOLUTION
The following are three workarounds for this issue:
 * Use a full OLE DB provider. Do not use an OLE DB provider that was written with the OSP Toolkit with RDS. Instead, use a full OLE DB provider. The OLE DB SDK, which is now part of the MDAC SDK, provides a sampleprovider (SAMPPROV) that may be used as the basis for writing a full OLE DB Provider.
 * Use the OLEDB Provider Template.
 * Pass the recordset back from a business object in another recordset object that was created by the RDSServer.DataFactory CreateRecordset method, instead of using the DataFactory's Query method.

With RDS, you can create a business object that returns a recordset. You could create a normal ADO recordset against the provider that was generated by OSP, and then create a new recordset dynamically through the RDS CreateRecordset method, or by using the Fields.Append method and opening the recordset. Once you have a second recordset, copy the data from the OSP recordset into the new recordset. This is the recordset you pass to your RDS client, and optionally, receive updates from as well. You can pass the RDS-created recordset between the client and the server and use the Recordset.Status field of the recordset that was returned from the client to determine which records are new, to be deleted, or modified, and from there, issue SQL statements against the OSP-provider exposed datasource.

Please refer to the articles in the "References" section for more information.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
 Install Microsoft Data Access Components (MDAC) Software Development Kit (SDK). The latest version of the MDAC SDK is version 2.5, which ships with Microsoft Windows 2000 Advanced Server or can be downloaded as part of the Platform SDK:

http://www.microsoft.com/msdownload/platformsdk/setuplauncher.htm

 Build the Visual C++ OSP sample that comes with the OSP Toolkit. Use Internet Explorer to invoke the following RDS test page:

http://your_machine/MSADC/Samples/adctest.asp

  Change the fields on the page to the following:   ADC Server:          http://your_machine Connection:         "provider=SampleOSP_VC; data source=ospsampc" Query:              Type in the path to the Customer.txt file that comes with the Visual C++ OSP sample. Recordset Status:   Complete Execute Option:     Synchronous  Click Run.</li></ol>

The error 0x80004005 (Unspecified error) occurs.

<div class="references_section">