Error occurs on RDA.LocalConnectionString when you use a large string (317341)



The information in this article applies to:

  • Microsoft SQL Server 2000 Windows CE Edition
  • Microsoft SQL Server 2000 Windows CE Edition 1.1

This article was previously published under Q317341

SYMPTOMS

A Microsoft SQL Server 2000 Windows CE Edition (SQL Server CE) Remote Data Access (RDA) application may fail with the following error message:
Set Property Failed
The error message may occur if you specify a large string by using the LocalConnectionString property of the RDA object that is used to specify the local database connection properties.

CAUSE

RDA fails if the LocalConnectionString property of the RDA object has more than 130 characters.

RESOLUTION

To resolve this problem, specify a string less than 130 characters for the RDA LocalConnectionString property.

MORE INFORMATION

This problem does not occur if you specify a long connection string for the Replication object's AddSubscription method or for the Microsoft ActiveX Data Objects for Windows CE (ADOCE) Connection object's Open method

Steps to Reproduce Behavior

The following sample code assumes that you have applied Microsoft SQL Server CE 1.1 Service Pack 1 (SP1). SQL Server CE 1.1 SP1 adds support for the SSCE:Temp File Directory property in the connection string to change the location of temporary database files. For more information about use of this property and to obtain SQL Server CE 1.1 SP1, see the following articles in the Microsoft Knowledge Base:

305349 FIX: SSCE:Temp File Directory Property Allows You to Change the Temp Database Location for SQL Server CE

317032 HOW TO: Change the Temp Database Location in SQL Server CE

'Local connection string for SSCE
Const strLocalConnect = "Provider=Microsoft.SQLServer.OLEDB.CE.1.0;Data Source=\Windows\RDA.SDF;SSCE:Database Password='pass';SSCE:Encrypt Database=TRUE;SSCE:Temp File Directory =\"

'Connection string for backend SQL Server
Const strRemoteConnect = "provider=sqloledb;data source=mySQLServerName;Initial Catalog=Northwind;user id=myUser;password=myPwd"

'Initialize variable for objects in RDA and ADOCE

Dim ceRDA As SSCE.RemoteDataAccess
Dim ceRepl As SSCE.Replication

' Create database using Replication Object
    Set ceRepl = CreateObject("SSCE.Replication.1.0")
    ceRepl.SubscriberConnectionString = strLocalConnect
    ceRepl.AddSubscription CREATE_DATABASE
    Set ceRepl = Nothing

    'initialize RDA
    Set ceRDA = CreateObject("SSCE.RemoteDataAccess.1.0")
    'Set properties for RDA
    'This property tell RDA what database to reference
    ceRDA.LocalConnectionString = strLocalConnect

    ceRDA.InternetURL = "http://myIISServer/VirtualDir/Sscesa10.dll"

    'define SQL string for Pull method
    sqlString = "SELECT * FROM Customers;"
    MsgBox sqlString
    ceRDA.Pull "lCustomers", sqlString, strRemoteConnect, TRACKINGON

				

The following line of code
ceRDA.LocalConnectionString = strLocalConnect
				
fails with this error message:
Set Property Failed

Modification Type:MinorLast Reviewed:9/20/2005
Keywords:kbprb KB317341