How To Use SQL Server CE OLE DB Provider-Specific Properties in eVB (276985)



The information in this article applies to:

  • Microsoft SQL Server 2000 Windows CE Edition

This article was previously published under Q276985

SUMMARY

The OLE DB specification allows data providers to implement provider-specific properties. These properties allow the programmer to have access to functionality that is outside the boundaries of the OLE DB specification. The SQL CE Books Online topic SQL Server CE OLE DB Properties Reference describes OLE DB standard and provider-specific properties that are supported by SQL CE OLE DB Provider.

You can use a given property name (for example, DBPROP_INIT_DATASOURCE) in an eVC++ OLE DB application. The description of a property usually documents the name (for example, Data Source) you can use in an eVB ADOCE application. However, for provider-specific properties, you need to add the "SSCE:" prefix to the property description.

Provider-Defined Properties in DBPROPSET_SSCE_DBINIT

Name (OLE DB)Description (ADOCE)
DBPROP_SSCE_DBPASSWORD SSCE:Database Password
DBPROP_SSCE_ENCRYPTDATABASESSCE:Encrypt Database

Provider-Defined Properties in DBPROPSET_SSCE_SESSION

Name (OLE DB)Description (ADOCE)
DBPROP_SSCE_MAXBUFFERSIZESSCE:Max Buffer Size

MORE INFORMATION

For additional details on how to use database password and encryption properties, review the SQL CE Books Online topic Creating Secure Databases. You can specify these properties in the connection string as follows:
"provider=Microsoft.SQLSERVER.OLEDB.CE.1.0;data source=\secure.sdf; SSCE:Database Password='pass';SSCE:Encrypt Database=TRUE"
				
The SSCE:Max Buffer Size property specifies the largest amount of memory, in kilobytes, that SQL Server CE can use before it starts flushing changes to disk. You cannot specify this property in the connection string, or it will report an error. You can set this property after opening the connection, as follows:
    cn.Open "provider=MICROSOFT.SQLSERVER.OLEDB.CE.1.0; data source=\temp\ssce.db"
    
    cn.Properties("SSCE:Max Buffer Size") = 256  
				
To implement this in eVC++, review the SQL CE Books Online topic Session Properties.

REFERENCES

SQL CE Books Online topic SQL Server CE OLE DB Properties Reference.

Modification Type:MinorLast Reviewed:7/13/2004
Keywords:kbhowto KB276985