473,398 Members | 2,165 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,398 software developers and data experts.

[ODBC] How to compact a base ?

Hello,
I'm developping a java application which use an ms-access database via
jdbc/odbc bridge.
However, it seems that ms-access databases have to regularly been
compacted (for indexes and page size).
So how can I do it from java since I haven't got Access nor vb ?

thank you :)
Nov 13 '05 #1
3 2698
yves piel wrote:
Hello,
I'm developping a java application which use an ms-access database via
jdbc/odbc bridge.
However, it seems that ms-access databases have to regularly been
compacted (for indexes and page size).
So how can I do it from java since I haven't got Access nor vb ?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The Access DBEngine has to be running or you wouldn't be able to access
the data. That said, using Automation, you can use this command:

DBEngine.CompactDatabase olddb, newdb, locale, options, password

From the Access Help file:

/begin quote/

olddb - A String that identifies an existing, closed database. It can be
a full path and file name, such as "C:\db1.mdb". If the file name has an
extension, you must specify it. If your network supports it, you can
also specify a network path, such as "\\server1\share1\dir1\db1.mdb".

newdb - A String that is the file name (and path) of the compacted
database that you're creating. You can also specify a network path. You
can't use the newdb argument to specify the same database file as olddb.
/ end quote /

Locale, options and password parameters are optional. Leave them alone
if you just want the same type, version, etc. as the oldDB. If the DB
is password protected set the password parameter to ";pwd=ThePassword".
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQxNMCYechKqOuFEgEQLBVQCgqhRZ3AC4uMSLOY9G0ZmMOS V4gTwAoPWZ
sLqPxRtMVwgnFPyHABQCPtzm
=5G95
-----END PGP SIGNATURE-----
Nov 13 '05 #2
thank you :)

MGFoster wrote:
yves piel wrote:
Hello,
I'm developping a java application which use an ms-access database via
jdbc/odbc bridge.
However, it seems that ms-access databases have to regularly been
compacted (for indexes and page size).
So how can I do it from java since I haven't got Access nor vb ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The Access DBEngine has to be running or you wouldn't be able to access
the data. That said, using Automation, you can use this command:

DBEngine.CompactDatabase olddb, newdb, locale, options, password

From the Access Help file:

/begin quote/

olddb - A String that identifies an existing, closed database. It can be
a full path and file name, such as "C:\db1.mdb". If the file name has an
extension, you must specify it. If your network supports it, you can
also specify a network path, such as "\\server1\share1\dir1\db1.mdb".

newdb - A String that is the file name (and path) of the compacted
database that you're creating. You can also specify a network path. You
can't use the newdb argument to specify the same database file as olddb.
/ end quote /

Locale, options and password parameters are optional. Leave them alone
if you just want the same type, version, etc. as the oldDB. If the DB
is password protected set the password parameter to ";pwd=ThePassword".


But what is the DBEngine ? THe application use a
jdbc(java)/odbc(windows). So How can I access DBEngine from odbc ?

thanks :)
Nov 13 '05 #3
You might be able to use JRO (Jet Replication Objects)

See whether the VC++ example in http://support.microsoft.com/?id=230501
helps.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"yves piel" <yv************@free.fr> wrote in message
news:43***********************@news.free.fr...
Hello,
I'm developping a java application which use an ms-access database via
jdbc/odbc bridge.
However, it seems that ms-access databases have to regularly been
compacted (for indexes and page size).
So how can I do it from java since I haven't got Access nor vb ?

thank you :)

Nov 13 '05 #4

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

Similar topics

0
by: Marco Aschwanden | last post by:
Hi - Win2000 - Python 2.3.3 - py2exe 0.5.0 - eGenix Comercial & Base Package I am developing an app using mxODBC. On the home page they say ...
1
by: David Lozzi | last post by:
This happens a lot to my databases. I store them at the root of my developing files, i.e. c:\My Projects\Proj1\database.mdb. Randomly, the security settings on this database will drop to the basic...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
6
by: serge calderara | last post by:
Dear all, Does any one have any idea why an sql statment with INNER JOIN syntax is working well with odbcprovider but not with Oledbprovider when accessing an access 2000 database? here is...
2
by: Indiana Epilepsy and Child Neurology | last post by:
Before asking this questions I've spent literally _years_ reading (Meyer, Stroustrup, Holub), googling, asking more general design questions, and just plain thinking about it. I am truly unable to...
4
by: Andreas Lauffer | last post by:
Can anyone tell me advantages / disadvantages of DataDirect Server Wire ODBC-driver? Any experiences? What about redistribution? Andreas Lauffer, easySoft. GmbH, Germany
2
by: Hans Kesting | last post by:
Is it possible to mix code meant for the CompactFramework and code meant for the standard framework? We are trying to make PDA and light-weight "laptop" versions of one application. This means a...
1
by: Michael Meckelein | last post by:
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?
2
by: Matt | last post by:
Hi All, Here is my situation: I have a database that needs to be compacted and repaired nightly. I have the process working and ready to go, but I have hit a snag with an ODBC password. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.