English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1 answers

'Checkmark in Project preferences: Microsoft DAO 3.6 Object Library

Const dbVersion11 = 8
Const dbVersion20 = 16
Const dbVersion30 = 32
Const dbVersion40 = 64 'current use

Sub CreateNewMDB(FileName, Format)
Dim xEngine
Set xEngine = CreateObject("DAO.DBEngine.36")
xEngine.CreateDatabase FileName, ";LANGID=0x0409;CP=1252;COUNTRY=0", Format
End Sub

Private Sub Command1_Click()
CreateNewMDB "c:\MSaccess2000.mdb", dbVersion40
End Sub

'check link also...

ADDED :
Please use this:
‘=============================================================
Sub CreateNewMDB(FileName)
Dim xEngine
Set xEngine = CreateObject("DAO.DBEngine.36")
xEngine.CreateDatabase FileName, ";LANGID=0x0409;CP=1252;COUNTRY=0", 64
End Sub

Private Sub Command1_Click()
Dim FileName as String

‘the ONLY variable you have to change!
FileName= “c:\ATTENDANCE.mdb”

CreateNewMDB Filename

End Sub
‘=============================================================

Answer:
1.Use for different versions of Access database. We use 64 to create 2000 version.
2.Refer to FileName above. The ONLY variable you will change. Please check the PATH of the database.

2006-08-07 17:20:07 · answer #1 · answered by VBACCESSpert 5 · 0 0

fedest.com, questions and answers