I am currently working in VB.NET with SQL Mobile 2005. I am trying to compact a database, .sdf, using the SqlCeEngine Object compact(connectionstring). When I use this code to compact a small database, only about 300KB, it returns okay however when I try to compact a larger database, about 9MB, it returns with a SQL Error Code: 0, "The operation completed successfully" however with no compacted database. The code works however it only seems to work for smaller databases. Does anyone have any ideas on how to correct this error or tell me why it returns with that type of error.
Snuggs

Compact Database Error Code: 0
han33981
Yes actual copy of the database itself. Before sharing it to me, can you check whether the DB is in correct state. compact.exe /verify would let you know if there any bad pages in the DB.
Thanks,
Laxmi NRO, MSFT, SQL Mobile, Microsoft Corporation
CarineY
MattiV
Hi Snuggs,
As per our conversation I could see that you have opened a bug here in Product Feedback center. http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx feedbackid=d0f14331-1b05-418a-9a11-2378457e4eb8
And as mentioned we could not repro. We are able to compact the DB very easily with a sample C# program mentioned in the above URL.
Thanks,
Laxmi NRO, MSFT, SQL Mobile, Microsoft Corporation
dtrade
James Y
H_H_2006
I am able to compact the database of size nearly 21 MB in our lab. Is it possible for you to share the repro for us to diagnose.
Thanks,
LaxmI NRO, MSFT, SQL Mobile, Microsoft Corporation