Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q266886

↑ Back to the top


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.

↑ Back to the top


More information

To create your handler, perform the following steps:
  1. Create an .ini file for the RDS handler. For example, the following .ini file defines the "MyDatabase" data source to connect to the ODBC data source name (DSN) "MyServer":
    [connect MyDatabase]
    Access=ReadWrite
    Connect="DSN=MyServer"
    
    [sql authors]
    ;If we want to disable unknown SQL values, we set Sql to an invalid query.
    Sql="select * from pubs.dbo.authors"
    						
    Notice the use of the Handler property for the control, and the use of the handler names "MyDatabase" and "authors". "MyDatabase" is defined in the Connect item of the .ini file as "authors", which will hold the SQL select to be used.
  2. Place the .ini file in the Winnt folder of the RDS Server computer.
  3. Create the object tag in HTML for the RDS data control. It should resemble the following:
    <HTML>
    <BODY>
    <OBJECT CLASSID="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
            ID="dsoData" HEIGHT="0" WIDTH="0">
      <PARAM NAME="Server" VALUE="http://MyIISServer">
      <PARAM NAME="Connect" VALUE="Data source=MyDatabase">
      <PARAM NAME="Handler" VALUE="MSDFMAP.Handler,dfmap.ini">
      <PARAM NAME="SQL" VALUE="authors">
    </OBJECT>
    
    <TABLE ID="tblData" DATASRC="#dsoData" BORDER=1>
      <TR><TD><INPUT TYPE="TEXT" DATAFLD="au_id"></TD></TR>
    </TABLE>
    </BODY>
    </HTML>
    					
  4. In the .ini file, replace "MyServer" with the name of your DSN.
  5. In the HTML object tag, replace "MyIISServer" with the name of your server.

↑ Back to the top


References

230680� INFO: Working with RDS Handlers

↑ Back to the top


Keywords: KB266886, kbhowto

↑ Back to the top

Article Info
Article ID : 266886
Revision : 5
Created on : 7/13/2004
Published on : 7/13/2004
Exists online : False
Views : 491