Managing 64-bit Database Applications
SQL Server Compact 4.0 is an in-process database, which means deployment and operating environment resources are minimized to suit the needs of embedded databases within applications. Because components are in-process, they must run in both 32- or 64-bit environment. The format of data in the database is not different for 32 bit or 64-bit runtimes.
Databases created by SQL Server Compact 64-bit can be accessed by 32-bit runtimes and that created by SQL Server Compact 32-bit can be accessed by 64-bit runtimes.
SQL Server Compact includes side-by-side support for32-bit and 64-bit runtime scenarios. Side-by-side support can be useful if you are required to support older clients using legacy database formats along with more recent formats.
The 32-bit and the 64-bit runtimes of SQL Server Compact 3.5 SP2 can be installed next to both 32-bit and 64-bit version of SQL Server Compact 4.0.
For opening database files created by older versions of SQL Server Compactyou would require to upgrade the database file to SQL Server Compact 4.0 version. The databases are not backward compatible with SQL Server Compact 3.5 SP2. For information about upgrading older database files, see Upgrading from Earlier Versions (SQL Server Compact), or Upgrade.
Database files created with SQL Server Compact 4.0 64-bit are the same format as files created by SQL Server Compact 4.0 32-bit. On a 64-bit machine, both the 32-bit and 64-bit runtimes of SQL Server Compact 4.0 can work on the same database file concurrently.
This section describes 64-bit compatibility for Visual Studio Server Explorer.
Visual Studio 2010 SP1 run in WOW64 mode on 64-bit clients. Because of this, the 32-bit components of SQL Server Compact must be installed to use the tools available within Visual Studio 2010 SP1. Since the 32-bit runtime components are installed by the 64-bit setup; hence completing only the 64-bit runtime setup on the box is sufficient for this purpose. In addition, to get the designer support in Visual Studio 2010 SP1 for SQL Server Compact 4.0, the design time components of SQL Server Compact 4.0 also need to be installed on an existing installation of Visual Studio 2010 SP1. The design time components can be installed by running the Windows Installer (.MSI) file –Microsoft Visual Studio 2010 SP1 Tools for SQL Server Compact 4.0.
Database File Compatibility
Visual Studio 2010 SP1 supports developing applications for both SQL Server Compact 3.5 SP2 and SQL Server Compact 4.0. Using Server Explorer one can connect to the a SQL Server Compact 3.5 SP2 or a SQL Server Compact 4.0 database file and browse the data in them.
If all prerequisites are deployed privately, by including the native DLLs directly within your project, the resources must be placed in top-level folders of the project. A folder must be created for each processor architecture type, including x86 and AMD64. Itanium 64 is not supported. To display the processor architecture type for a specified computer, open a command prompt and run the following command:
To display the same information in a window with VBScript, run the following code:
Set WshShell = WScript.CreateObject("WScript.Shell") Set WshSysEnv = WshShell.Environment("SYSTEM") WScript.Echo WshSysEnv("PROCESSOR_ARCHITECTURE")
For more information about deploying 64-bit applications, see "Deploying 64-bit Applications" in the Visual Studio documentation. For more information about deploying desktop applications built with SQL Server Compact, see Deploying Desktop Applications.
For SQL Server Compact 4.0, the 64-bit SQL Server Compact Runtime MSI has been integrated into ClickOnce deployment. If a user installs an application built with SQL Server Compact 4.0 on a 64-bit system by using ClickOnce technology, and SQL Server Compact 4.0 was selected as an installation prerequisite by the publisher, then the 64-bit SQL Server Compact Runtime is installed, since it installs both the WOW64 and x64 components of SQL Server Compact. Similarly on a 32-bit machine the 64-bit SQL Server Compact runtime is installed..