473,789 Members | 2,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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 2716
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.Compac tDatabase 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\shar e1\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=ThePasswo rd".
--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQxNMCYechKq OuFEgEQLBVQCgqh RZ3AC4uMSLOY9G0 ZmMOSV4gTwAoPWZ
sLqPxRtMVwgnFPy HABQCPtzm
=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.Compac tDatabase 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\shar e1\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=ThePasswo rd".


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
2250
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 http://www.egenix.com/files/python/mxODBC.html#Hints
1
3126
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 secutiry, myself and SYSTEM. I need IUSR on it so I can access it through my ASP pages... I get errors like this: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) The Microsoft Jet database engine cannot open the file '(unknown)'. It...
11
3766
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 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
6
2687
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 the code I have used with oledbprovider which fails Dim monodbc As New OleDb.OleDbConnection 'Odbc.OdbcConnection
2
3055
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 figure out what would be a "proper" OO design (in C++) for this. There may be alternatives to writing my own ODBC handle classes, and I may be interested in them, but I'd like to pursue this particular problem, if for no other reason than to...
4
5652
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
2006
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 lot of functionality is identical (or at least similar). As the compact framework is a subset (correct?) of the full framework, we had the idea of building the base functionality as "compact" projects. Thse projects could then be used (or...
1
3186
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
1839
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 have a query that runs at every :02 and :32 of the hour. The first time this runs (The first :02 or :32 on the hour after I have opened it) I must put the ODBC password in. Every time after that the
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10195
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9016
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.