compact a Microsoft Access database through odbc

M

Michael Meckelein

Hi,



My csharp application access a MS Access database through odbc connection.
Is there a way to compact the Access database after deleting records using
the odbc connection?



I found out how to do this with Microsoft Jet and Replication Objects
Library [1], but unfortunately it seems that there is no way with ODBC.



Any glue how this can be achieved are very welcome.



Michael



[1] How to compact a Microsoft Access database by using Visual Basic .NET

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306287
 
M

Michael Meckelein

My csharp application access a MS Access database through odbc connection.
Is there a way to compact the Access database after deleting records using
the odbc connection? [snip]
Any glue how this can be achieved are very welcome.

I have done a lot of research about this topic. Unfortunately I found no
solution. I found many issues on this topic. Some people use
SQLConfigDataSource [1] to compact the database via odbc. But in my case I
have to use an already existing system DSN. The path to the database is
unknown. Therefore I can't use this approach nor the JetEngine.



Any hint/suggestion/... is highly appreciated.



BTW: Just have the idea to read out the database path from the ODBC source.
Is this possible? Then I can use this as a workaround, read out the path and
then use theJetEngine.



Thanks in advance,

Michael


[1] SQLConfigDataSource(NULL,ODBC_ADD_DSN,(LPSTR)"Microsoft Access Driver
(*.mdb)",
"COMPACT_DB=C:\\source.mdb C:\\dest.mdb General\0\0");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top