473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

compacting access databases in vb .net

hi,

i have an access database file attached to an app via ado, that needs to be
compacted and repaired from time to time. in regular vb i would do it thru

DBEngine.CompactDatabase sDataBaseBackupFile, sDatabaseFile
how do this in vb .net ado ?

i would appreciate a snippet of code, and if i have to add a referencer in
my solution to some specific file.

thanks for any help

ray

please respond to the list




Nov 20 '05 #1
4 4461
* "ray well" <no****@nospam.com> scripsit:
i have an access database file attached to an app via ado, that needs to be
compacted and repaired from time to time. in regular vb i would do it thru

DBEngine.CompactDatabase sDataBaseBackupFile, sDatabaseFile
how do this in vb .net ado ?

i would appreciate a snippet of code, and if i have to add a referencer in
my solution to some specific file.


ADO.NET group:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes.asp?icp=msdn&slcid=us&newsgroup=microso ft.public.dotnet.framework.adonet>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb
* "ray well" <no****@nospam.com> scripsit:
i have an access database file attached to an app via ado, that
needs to be compacted and repaired from time to time. in regular vb
i would do it thru

DBEngine.CompactDatabase sDataBaseBackupFile, sDatabaseFile
how do this in vb .net ado ?

i would appreciate a snippet of code, and if i have to add a
referencer in my solution to some specific file.


ADO.NET group:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>


I think you can _not_ compact an access database with ADO.NET.
Ray, you can use JRO ("Microsoft Jet and Replication Objects 2.6 Library")
via COM interop to compact a database. See JRO.JetEngine.CompactDatabase.
--
Armin

Nov 20 '05 #3
* "Armin Zingler" <az*******@freenet.de> scripsit:
DBEngine.CompactDatabase sDataBaseBackupFile, sDatabaseFile
how do this in vb .net ado ?

i would appreciate a snippet of code, and if i have to add a
referencer in my solution to some specific file.
ADO.NET group:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>


I think you can _not_ compact an access database with ADO.NET.


I know that... But I think that's the better place to ask the question.

;-)
Ray, you can use JRO ("Microsoft Jet and Replication Objects 2.6 Library")
via COM interop to compact a database. See JRO.JetEngine.CompactDatabase.


ACK.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
On Wed, 22 Oct 2003 10:38:54 -0400, "ray well" <no****@nospam.com> wrote:

¤ hi,
¤
¤ i have an access database file attached to an app via ado, that needs to be
¤ compacted and repaired from time to time. in regular vb i would do it thru
¤
¤ DBEngine.CompactDatabase sDataBaseBackupFile, sDatabaseFile
¤ how do this in vb .net ado ?
¤
¤ i would appreciate a snippet of code, and if i have to add a referencer in
¤ my solution to some specific file.
¤

Here is the MS KB article:

HOW TO: Compact a Microsoft Access Database by Using Visual Basic .NET
http://support.microsoft.com/default...&Product=vbNET
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Peter Verhelst | last post by:
Hello, Currently I am running an Access database on a windows WTS server, running Microsoft Windows 2000 server 5.00.2195 Service Pack 3. This database should be accessible for everybody in our...
1
by: Annette Massie | last post by:
I have an Access 2000 database we originally had on a server in our network and used asp to connect to it, browse and display records. I have queries that run at 3:00 am in the morning to delete...
5
by: lappy | last post by:
Hello, I have written a small programme to compact an access 97 database. Dim je As New JRO.JetEngine ' Compacts database Data.Mdb to Data2.mdb. je.CompactDatabase...
1
by: jez123456 | last post by:
Hi, I'm quite new to c# but have been tasked with writing a c# application that will compact upto 5 microsoft access databases. I'm not too sure where to start with this, ie should I create a...
3
by: robert d via AccessMonster.com | last post by:
I develop my application on my desktop which has Access 2002 (default file format of A2K). My client uses A2K so I have installed A2K on my laptop. Recently when developing in A2002 my front end...
10
by: Sonnich | last post by:
Hi all! I am (still) running some tests (dispite my problems), and I'd like to know the size of data I have in order to calculate growth. As a test I added some data, 1.69 Gb to be exact to a...
5
by: MightyAC | last post by:
Corrupt data in an access database seems to occur far too often. What's worse is that compacting an access 2000 or later db with corrupt data can result in the destruction of relationships. It...
1
by: Slez via AccessMonster.com | last post by:
I do a routine compact and repair on a back end MS Access 2002 database. This time I had something peculiar occur. The compact started as normal, than the following error message popped up (I...
3
by: DSSMaster | last post by:
I am trying to use windows scheduler to compact a database. In the task run line I have the following: "C:\Program Files\Microsoft Office\OFFICE11 MSACCESS.EXE" _ "C:\Files\Access\Sacroc.mdb"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.