Microsoft KB Archive/266886

= How To Use a Remote Data Service (RDS) Handler with an RDS Data Control =

Article ID: 266886

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Remote Data Service for ADO 2.0
 * Microsoft Remote Data Services 2.1
 * Remote Data Service for ADO 2.5
 * Microsoft Data Access Components 2.0
 * Microsoft Data Access Components 2.1
 * Microsoft Data Access Components 2.5

-



This article was previously published under Q266886



SUMMARY
Beginning with Microsoft Data Access Components (MDAC) version 2.0, the Remote Data Services (RDS) components support the concept of an RDS handler. By using RDS handlers, you hide the actual connection string and query string from the user.

You can take advantage of RDS handlers by setting the Handler property of the RDS.DataControl object. The documentation is not entirely clear on this subject; this article provides a simple example of how to create your own handler to be used with the RDS.DataControl object.



MORE INFORMATION
To create your handler, perform the following steps:   Create an .ini file for the RDS handler. For example, the following .ini file defines the &quot;MyDatabase&quot; data source to connect to the ODBC data source name (DSN) &quot;MyServer&quot;: [connect MyDatabase] Access=ReadWrite Connect=&quot;DSN=MyServer&quot;

[sql authors] Sql=&quot;select * from pubs.dbo.authors&quot; Notice the use of the Handler property for the control, and the use of the handler names &quot;MyDatabase&quot; and &quot;authors&quot;. &quot;MyDatabase&quot; is defined in the Connect item of the .ini file as &quot;authors&quot;, which will hold the SQL select to be used.  Place the .ini file in the Winnt folder of the RDS Server computer.  Create the object tag in HTML for the RDS data control. It should resemble the following:        </OBJECT>
 * If we want to disable unknown SQL values, we set Sql to an invalid query.

</BODY> </HTML> </li> In the .ini file, replace &quot;MyServer&quot; with the name of your DSN.</li> In the HTML object tag, replace &quot;MyIISServer&quot; with the name of your server.</li></ol>

<div class="references_section">