Export (0) Print
Expand All

The LocalConnectionString property specifies the OLE DB connection string for the SQL Server Compact 3.5 database on the Microsoft Windows CE-based device.


object.LocalConnectionString(value)

SQL Server Compact 3.5 RDA object

String

Read/write

HRESULT get_LocalConnectionString(BSTR *pVal);
HRESULT put_LocalConnectionString(BSTR newVal);

Parameter

Description

value

The OLE DB connection string for the SQL Server Compact 3.5 database.


The following table shows the available property names for the OLE DB connection string.

Property

Description

data source

The file path and name of the SQL Server Compact 3.5 database. Specify the absolute path of the database file instead of a relative path.

An application that is running on a desktop computer cannot open a database connection to an .sdf file on a device. Similarly, an application that is running on a device cannot open a database connection to an .sdf file on a desktop computer.

ssce: database password

The database password, which can be up to 40 characters in length. If not specified, the default value is no password. This property is required if you enable encryption on the database. If you specify a password, encryption is enabled on the database. If a blank password is supplied, the database will be unencrypted.

ssce: encrypt database

A Boolean value that determines whether the database is encrypted. Must be set to true to enable encryption or false for no encryption. If not specified, the default value is false. If you enable encryption, you must also specify a password with the password property. If you specify a password, encryption is enabled regardless of how you set this property. If a password is specified, the database is encrypted regardless of whether SSCE:Encrypt Database is specified.

The encrypt property will be deprecated in a future release. The property is retained in SQL Server Compact 3.5 for backward compatibility.

ssce:encryption mode

or

encryption mode

The values for this property are engine default, platform default, or ppc2003 compatibility.The default is platform default.

ssce: max buffer size

The largest amount of memory, in KB, that SQL Server Compact 3.5 can use before it starts flushing changes to disk. If not specified, the default value is 640.

ssce: max database size

The maximum size of the database, in MB. If not specified, the default value is 128.

ssce:mode

The mode to use when you open the database file. For valid values, see the table that follows. If not specified, the default value is Read/Write.

ssce: default lock timeout

The default number of milliseconds that a transaction will wait for a lock. If not specified, the default value is 2000.

ssce: default lock escalation

The number of locks a transaction will acquire before you try escalation from row to page, or from page to table. If not specified, the default value is 100.

ssce: flush interval

Specifies the interval time in seconds before all committed transactions are flushed to disk. If not specified, the default value is 10.

ssce: autoshrink threshold

The percentage of free space in the database file that is permitted before autoshrink begins. A value of 100 disables autoshrink. If not specified, the default value is 60.

ssce: temp file directory

The location of the temporary database. If not specified, the default is to use the database specified in the data source property for temporary storage.

ssce: temp file max size

The maximum size of the temporary database file, in MB. If not specified, the default value is 128.

locale identifier

The locale ID (LCID) to use with the database.

ssce:case sensitive

A Boolean value that determines whether the database is case-sensitive. Must be set to true to enable case sensitivity or false for case insensitivity. If not specified, the default value is false.

This connection property was introduced in SQL Server Compact 3.5 SP1.

The following table shows valid values for the mode property of the connection string.

Value

Definition

Read Write

Lets multiple processes open and modify the database. This is the default setting if the mode property is not specified.

Read Only

Lets you open a read-only copy of the database.

Exclusive

Does not let other processes to open or modify the database.

Shared Read

Lets other processes read, but not modify, the database while you have it open.

The following rules apply to connection strings:

  • All blank characters, except those within a value or within quotation marks, are ignored.

  • Keyword value pairs must be separated by a semicolon (;). If a semicolon is part of a value, it also must be delimited by quotation marks.

  • No escape sequences are supported.

  • The value type is irrelevant.

  • Names are not case-sensitive.

  • If a property name occurs more than one time in the connection string, the value associated with the last occurrence is used.

  • Values can be delimited by single or double quotation marks, for example, name='value' or name="value". Either single or double quotation marks can be used within a connection string by using the other delimiter. For example, the following are valid uses of quotation marks within a connection string:

    "data source='MyDb.sdf'; ssce: mode=Exclusive;"
    'data source="MyDb.sdf"; ssce: mode=Exclusive;'
    
    • But these examples are not valid:

    "data source="MyDb.sdf"; ssce: mode=Exclusive;"
    'data source='MyDb.sdf'; ssce: mode=Exclusive;'
    
Show:
© 2014 Microsoft