Re: Create an Access 2000 format database using DAO?



Hi Rob,

This did the trick! Thanks much for the updated code snippet.

You da man!

Cory

"Robert Morley" wrote:

The gist of it is that only the Forms, Reports, Macros and Modules are
stored in a different format for each. The Tables and Queries are stored in
a generic format that's the same for both. Since DAO only knows about
Tables and Queries, it can't really create a database that's one or the
other; it creates a v4.0 database which is later modified by Access itself
to be whichever format it wants. This also explains the behaviour you saw
with your code in Alex's sub-thread; there's no version to the database
until you actually open it.

What the conversion utility does is to convert all the other objects from
2000 to 2002/2003. If you change your options to view System Objects,
you'll see an MSysAccessObjects in 2000 vs. and MSysAccessStorage in 2002/3.
This is where all the Forms, Reports, etc. are stored.

Oh and it appears that Norton has corrupted you. It's not "symantecs", it's
"semantics". ;)

Anyway, if it's important for you to select the database format before first
GUI access, try the following code instead. Note that if you need "tdb" to
point to the database once it's done, you'll have to re-open the database
through DAO afterwards. Access can't create the necessary table while DAO
has a lock on it (at least I don't think so...you can try opening it in
shared mode and see if that works out).

Public Sub MyCreateDatabase(ByVal TargetPath As String)
Dim tdb As DAO.database
Dim accapp As Access.Application
Dim PrevSetting As Variant

' create new microsoft access database file in Access 2000 format.
On Error Resume Next
Kill TargetPath
On Error GoTo 0

Set tdb = DBEngine.Workspaces(0).CreateDatabase(TargetPath, dbLangGeneral)
tdb.Close
Set tdb = Nothing

Set accapp = New Access.Application
PrevSetting = accapp.GetOption("Default File Format")
accapp.SetOption "Default File Format", 9
accapp.OpenCurrentDatabase TargetPath
accapp.CloseCurrentDatabase
accapp.SetOption "Default File Format", PrevSetting
Set accapp = Nothing

End Sub



Rob

Cory J. Laidlaw wrote:
Hi Robert,

Thanks for your feedback. I am a bit confused.

If they are the same format, why in access 2003 is there a tool(database
utilities( to convert them to 2000 format and when using a 2000 format
database, the tool converts a database up to 2002-03?

Your saying this is just symantecs of the current access application?

Thank you. I appreciate your feedback! :)

Cory



"Robert Morley" wrote:

If I recall correctly, at the low level, Access 2000 and Access 2002/2003
are actually the same database format. So if you create a Version40
database through code, the identifiers as to whether it's 2000 or 2002/3
will only be added when you open that database up through the GUI and
they're added by Access itself (as opposed to DAO). So at that point, as
Alex indicated, it's controlled by the setting in your preferences.

I'm a little rusty, so I might be wrong, but I'm pretty sure that's how it
works.


Rob

Cory J. Laidlaw wrote:
Hi,

I've tried the following line of code:

Set tdb = DBEngine.Workspaces(0).CreateDatabase(TargetPath, dbLangGeneral,
dbVersion30)

it creates an access 97 version of the database. This line of code:

Set tdb = DBEngine.Workspaces(0).CreateDatabase(TargetPath, dbLangGeneral,
dbVersion40)

Creates an access 2002-2003 version.

Does anyone know how to create an Access 2000 Version?
Many Thanks!!

Cory

.



Relevant Pages

  • Re: Protel 2004 answer to Brad Velander.
    ... Sorry, you misunderstand me, I mean to say that jump from 99SE to 2004 XP ... you don't have the same format with one database will all the documents. ... Well you said that you can export file format more recent than AUTOCAD 14 ... key/mouse click you press because I don't know how to do that with Protel ...
    (sci.electronics.cad)
  • Re: Access 2007 Security
    ... long as the file format remains as a Jet file. ... User-Level Security is not available. ... database, keep your database in MDB format and keep an earlier version of Access ...
    (microsoft.public.access.security)
  • Re: Combo box not finding record... sometimes
    ... Try the Format option last. ... Private Sub cboLnNum_AfterUpdate ... when I change the data type from Double to Long Integer the database ...
    (microsoft.public.access.formscoding)
  • Re: Error Message: Cant find Installable ISAM
    ... The database is residing on my machine, ... Error Message = "Couldn't find Installable ISAM" ... Connect property set = Access ... Access 2002/2003 format and tried this as a possibility, ...
    (microsoft.public.vb.database)
  • Re: What program is best for large inventory?
    ... put the information in the format that I want. ... down into several sub groups and some even further. ... The learning curve for general database concepts is moderate. ...
    (microsoft.public.office.misc)