数据的访问
SQL CE 数据库压缩
l Pages are reorganized
l Database statistics are updated
l Change encryption, password
l Dim eng As New Engine()
l eng.LocalConnectionString = _
l"Data Source=My Documents\DemoDB.sdf;Password='pass'“
l eng.Compact( _
l"Data Source=My Documents\DemoDB2.sdf.tmp;Password='pass'“)

| The Engine object can also be used to maintain a database by using the Compact method. Compacting a database reorganizes it’s data so unused space can be released to the operating system. In addition, the database will update its data-distribution statistics, resulting in better query performance. When compacting, you can also change a databases password and encryption settings.
| Once you’ve connected to your database, simply call the Compact method and provide another connection string with the new settings. At a minimum, this second connection string must point to a different file location than your original. This will result in a new database file, compacted and with your new security settings. You can then delete your old database and rename the new one.