Επεξεργασία

Κοινή χρήση μέσω


Required Client Settings

Important

Beginning with Windows 8 and Windows Server 2012, RDS server components are no longer included in the Windows operating system (see Windows 8 and Windows Server 2012 Compatibility Cookbook for more detail). RDS client components will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Applications that use RDS should migrate to WCF Data Service.

Specify the following settings to use a custom DataFactory handler.

RDS provides a default handler on the server named MSDFMAP.Handler. (The default customization file is named MSDFMAP.INI.)

Example

Assume that the following sections in MSDFMAP.INI and the data source name, AdvWorks, have been previously defined:

[connect CustomerDataBase]  
Access=ReadWrite  
Connect="DSN=AdvWorks"  
  
[sql CustomerById]  
SQL="SELECT * FROM Customers WHERE CustomerID = ?"  

The following code snippets are written in Visual Basic:

RDS.DataControl Version

Dim dc as New RDS.DataControl  
Set dc.Handler = "MSDFMAP.Handler"  
Set dc.Server = "https://yourServer"  
Set dc.Connect = "Data Source=CustomerDatabase"  
Set dc.SQL = "CustomerById(4)"  
dc.Refresh  

Recordset Version

Dim rs as New ADODB.Recordset  
rs.CursorLocation = adUseClient  

Specify either the Handler Property (RDS) property or keyword; the Provider Property (ADO) property or keyword; and the CustomerById and CustomerDatabase identifiers. Then open the Recordset object

rs.Open "CustomerById(4)", "Handler=MSDFMAP.Handler;" & _

"Provider=MS Remote;Data Source=CustomerDatabase;" & _  
"Remote Server=https://yourServer"  

See Also

Customization File Connect Section
Customization File SQL Section
Customization File UserList Section
DataFactory Customization
Understanding the Customization File
Writing Your Own Customized Handler