Export (0) Print
Expand All

Specifying the Location of the Temporary Database Using the Replication and RDA Controls

SQL Server 2000

Specifying the Location of the Temporary Database Using Replication and RDA Controls

You can explicitly specify the location of the temporary database by using both the Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) Replication and Remote Data Access (RDA) ActiveX® control objects by adding the following value at the end of the connection string:

"SSCE:Temp File Directory = temp_database_location"

Note  Property values in the connection string must be separated by semicolons, and the location of the temporary database path inside the connection string is not important.

For the Replication object, you must include the temporary database location for all methods that use a SubscriberConnectionString property. These methods are:

  • REPL_Object.Initialize
  • REPL_Object.AddSubscription
  • REPL_Object.Run
  • REPL_Object.ReinitializeSubscription
  • REPL_Object.DropSubscription

For the RDA object, you must include the temporary database location for all methods that use a LocalConnectionString property. These methods are:

  • RDA_Object.Pull
  • RDA_Object.Push
Examples
A. Using the SubscriberConnectionString property in the Replication object

The following Microsoft Visual Basic® example shows how to use the SubscriberConnectionString property in the SQL Server CE ActiveX Control Replication object.

' Declare the Replication object.
Dim ceRepl As SSCE.Replication
   
' Create the Replication object.
Set ceRepl = CreateObject("SSCE.Replication.2.0")
 
' Set Internet properties.
ceRepl.InternetURL = "http://www.northwindtraders.com/sqlce/sscesa20.dll"
ceRepl.InternetLogin = "MyInternetLogin"
ceRepl.InternetPassword = "<MyInternetPassword>"

' Set Publisher properties.
ceRepl.Publisher = "SamplePublisher"
ceRepl.PublisherDatabase = "Nwind_SQLCEReplDemo"
ceRepl.Publication = "SQLCEReplDemo"
ceRepl.PublisherSecurityMode = DB_AUTHENTICATION
ceRepl.PublisherLogin = "MySqlPublisherLogin"
ceRepl.PublisherPassword = "<MySqlPublisherPassword>"
 
' Set Subscriber properties.
ceRepl.SubscriberConnectionString = "data source=\NorthwindRepl.sdf;SSCE:Temp File Directory =temp_database_location"
ceRepl.Subscriber = "SQLCE Sub #1"

 ' Create the new anonymous subscription.
 ceRepl.AddSubscription CREATE_DATABASE   

B. Using the LocalConnectionString property in the RDA object

The following Visual Basic example shows how to use the LocalConnectionString property in the SQL Server CE RDA ActiveX control object.

' Declare the SQL Server CE RDA ActiveX control object.
Dim ceRDA As SSCE.RemoteDataAccess

' Create the RDA object.
Set ceRDA = CreateObject("SSCE.RemoteDataAccess.2.0")

' Set RDA properties.
ceRDA .InternetURL = "http://www.northwindtraders.com/sqlce/sscesa20.dll"
ceRDA .InternetLogin = "MyInternetLogin"
ceRDA .InternetPassword = "<MyInternetPassword>" 
ceRDA .LocalConnectionString = "Data Source=\NorthwindRDA.sdf;SSCE:Temp File Directory =temp_database_location"

' Push the tracked SQL Server CE table changes back to the SQL Server table.
ceRDA .Push "Customers", "Provider=sqloledb;Data Source=SampleServer;Initial Catalog=Northwind;user id=SampleUser;password=<SamplePassword>"  

See Also
CompactDatabase Method

Using SQL Server CE Temporary Databases

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft