how to create an Access XP/2003 database

6 views
Skip to first unread message

JR

unread,
Nov 2, 2005, 8:46:17 PM11/2/05
to
hi,

How can I select the version(compatibilty) for my database

I Use:
Set db_Temp = WrkSpace.CreateDatabase(MF, dbLangDutch, dbVersion40)
'office 2000
no problem. but when I select
Set db_Temp = WrkSpace.CreateDatabase(MF, dbLangDutch, 128)
'Office 2002
it is also access 2000


where MF is the Filename for the database

Jan


Jim Carlock

unread,
Nov 3, 2005, 1:35:07 AM11/3/05
to
Hi Jan,

I don't think it's possible to create an XP version using
DAO.

I took a look at the DBEngine.Version which returns
"3.6" and I tried setting using 128, 256, and 1024 as
the third parameter for DAO.CreateDatabase and
they all end up with a database of .Version = 64.

If you really need to create an XP version you might
have to use ADO or possibly use the following...

VB Properties Reference:
Microsoft Access 10.0 Object Library
%ProgramFiles%\Microsoft Office 10\MSACC.OLB

The Path might vary depending upon the folder Office10
is installed into.

I tried the following...
Dim idbVer As Long
'
idbVer = dbVersion40
'idbVer = dbVersion40 + 1& 'this creates a version 1.0(?) .mdb
'idbVer = 128& 'creates version = 64
'idbVer = 256&
'idbVer = 1024&
Set db_Temp = WrkSpace.CreateDatabase(MF, dbLangDutch, idbVer)
Call MsgBox("dbVersion = " & CStr(db_Temp.Version))
'...

Using the "Microsoft Access 10.0 Object Library" involves
creating an Access application object, then perhaps setting...

Private Sub CreateMDB2()
On Error GoTo ErrHandler
Dim oApp As Access.Application
Dim sFile As String, sDFF As String
Dim sSetting As String
'sSetting represents clicking on menu Options in Access
sSetting = "Default File Format"
Set oApp = New Access.Application
sDFF = oApp.GetOption(sSetting)
'Call MsgBox(sDFF)
Call oApp.SetOption(sSetting, "10") '9 is 2K mdb, 10 is XP mdb
sFile = App.Path & "\Test.mdb"
Call oApp.NewCurrentDatabase(sFile)
Call oApp.SetOption(sSetting, sDFF)
ExitHandler:
If (oApp Is Nothing) Then
'skip
Else
Set oApp = Nothing
End If
Exit Sub
ErrHandler:
Call MsgBox(CStr(Err.Number) & vbCrLf & Err.Description)
Resume ExitHandler
End Sub

Hope this helps.

--
Jim Carlock
Post replies to the newsgroup, thanks.

"JR" <XX...@XX.XX> wrote:
hi,

How can I select the version(compatibilty) for my database

I Use:
Set db_Temp = WrkSpace.CreateDatabase(MF, dbLangDutch, dbVersion40)
'office 2000 no problem. but when I select

JR

unread,
Nov 5, 2005, 3:55:43 PM11/5/05
to
thanks


"Jim Carlock" <anonymous@localhost> schreef in bericht
news:%2301fEDE...@tk2msftngp13.phx.gbl...

Reply all
Reply to author
Forward
0 new messages