HOWTO convert programmatically .MDB to .ACCDB

N

nico

Hi!

Any idea howto convert a MS Access 2003 Database (MDB-Format) to a MS
Access 2007 Database (ACCDB- Format) programmatically?


Suppose that MS Access 2007 is not installed.
The MDB-database is just a very simple one, without forms, VBA, security.
Just data.
Does exist a tool or an API function for this?


Thank you in advance,
Nicoleta
 
D

Douglas J. Steele

I doubt very much that that would work to convert to ACCDB if Access 2007
wasn't installed.

Nico: Why do you want to bother converting? There are no problems accessing
data that's in the format of previous versions of Access from newer versions
of Access.
 
D

Douglas J. Steele

I hadn't thought in terms of installing the ADE. Yes, that should work.

But it still begs the question of "why?"
 
A

Albert D. Kallal

Alex Dybenko said:
Hi Doug,
but if ADE is installed (why do you need accdb then?) then
compactdatabase - is a method of ADE, can be called from Word for example.
ADE can be installed without access:
http://accessblog.net/2007/01/microsoft-office-access-database.html

Very interesting link. I was not aware that the ACE engine was available as
a separate download.

Thanks for that tip Alex...

So, yes...one can then likely convert using code without having to install
ms-access (but, the 07 ACE engine does need to be installed).

As we say, there always more then one way to skin a cat....
 
N

nico

Hi,

sorry ... I was out of office for some days.

"Nico: Why do you want to bother converting? There are no problems accessing
data that's in the format of previous versions of Access from newer versions
of Access."

We have to decide for a dektop database for our project. In this project is
no need for the MS Access user interface. It is no need for reports, forms,
..... By default, the end-user will not need to operate directly the database.
We need just a very simple relational database engine. We think the MS
Access may be the right solution for the project. Now, there are 2 differents
formats: MDB and ACCDB. Which one should we choose? We analysed the
differences and we think that MDB is enough for the moment. But if in the
future it will be necessary to use the accdb format we want to be sure that a
programmatic conversion is not a problem.

Thank you for the tipps.
I tried to make a dummy test. I installed the Access Database Engine and the
Access 2007 Developer Extensions (ADE). I suppose I have to use the
CompactDatabse method of the ActiveX AccessDE.dll . I think the installation
was not successfull although was no error message. The ActiveX can't be
registered. The mso.dll and the msvcr80.dll are missing. And when I copy the
dlls from another folder to the actual one by registering it comes another
error message, error code: 0x80004001. Any ideea?

Is it possible also through ADO to convert/compact an Access database?

Thank you,
Nicoleta
 
B

Brendan Reynolds

We have to decide for a dektop database for our project. In this project
is
no need for the MS Access user interface. It is no need for reports,
forms,
.... By default, the end-user will not need to operate directly the
database.
We need just a very simple relational database engine. We think the MS
Access may be the right solution for the project. Now, there are 2
differents
formats: MDB and ACCDB. Which one should we choose? We analysed the
differences and we think that MDB is enough for the moment. But if in the
future it will be necessary to use the accdb format we want to be sure
that a
programmatic conversion is not a problem.
<snip>

Rather than trying to programmatically convert the MDB to an ACCDB, I would
create an ACCDB with empty tables and import the data from the MDB. It's
safer, in that it makes no changes to the original MDB. Its quite easily
done, you just have to import the tables in the correct order, that is to
say, import the table on the one side of a one-to-many relationship before
attempting to import the table on the many side. (Alternatively you could
create the new ACCDB without relationships defined, import the data, then
programmatically create the relationships.)
 
T

Tony Toews [MVP]

nico said:
"Nico: Why do you want to bother converting? There are no problems accessing
data that's in the format of previous versions of Access from newer versions
of Access."

We have to decide for a dektop database for our project. In this project is
no need for the MS Access user interface. It is no need for reports, forms,
.... By default, the end-user will not need to operate directly the database.
We need just a very simple relational database engine. We think the MS
Access may be the right solution for the project. Now, there are 2 differents
formats: MDB and ACCDB. Which one should we choose?

Jet 4.0 (DAO 3.6) is included in the Windows XP and Vista operating
systems so no install is required. ACCDBs will require an install of
the ACE engine. If your software requires an administrator to install
it then this isn't a problem. But if you can install the software
using a user account then I'd stick with Jet 4.0.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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