Reputation: 837
Most of the example codes on the internet use either access97 or 2000 format database.In a database creation code it was mentioned that if Jet OLEDB:Engine Type=4 is used the database created is access 97 format and if Type=5 than access 2000 format.But when i create a database with code using type=4 or even with the visual data manager, the format created is access 95(as shown when opened with MS access 2003).What things do I need to check to create Access 97 format database? Please help!
Upvotes: 2
Views: 1695
Reputation: 31
Hi.
I successed to Make Blank Access 97 Format MDB File with VBScript 32bit on Windows 10 + Access 2016 64 bit.
To Create "E:\TEST97.MDB" , Let Run this VBScript 32bit.(Run From Command Prompt(Cmd.exe) and paste %SystemRoot%\SysWow64\cscript.exe "C:\hoge\MakeAC97.vbs" and enter)
Language General(English and so on)
To Make Vbscript "C:\hoge\MakeAC97.vbs
Transfer Access 2003 Format mdb, "E:\test2000_2003.mdb
I can Access 1.0 - Access 2003 format mdb file
Code sample is this Japanese Article
[http://qiita.com/Q11Q/items/1793f43a1fd4dd3f480f]
And Using SQL on VBScript 32 bit, We can read Access 97 format mdb Table Data, directly.
[http://qiita.com/Q11Q/items/fc06d858ee0d3c9423f4]
Of Course, There is limited, But Access 2016 format accdb file Tables and Select Queries and Union Queries Transfer to Access 97 Format mdb.
[http://qiita.com/Q11Q/items/0ada315f6b5eb9b14f8b]
'%SystemRoot%\SysWow64\cscript.exe "C:\hoge\MakeAC97.vbs"
'Access 2013 Later
'64 / 32 Ok
Const DB_Lang_General = ";LANGID=0x0409;CP=1252;COUNTRY=0"
Const DB_LANG_JAPANESE = ";LANGID=0x0411;CP=932;COUNTRY=0"
Const DB_Lang_Arabic = ";LANGID=0x0401;CP=1256;COUNTRY=0"
Const DB_Lang_ChineseSimplified = ";LANGID=0x0804;CP=936;COUNTRY=0"
onst DB_Lang_ChineseTraditional = ";LANGID=0x0404;CP=950;COUNTRY=0"
Const DB_Lang_Cyrillic = ";LANGID=0x0419;CP=1251;COUNTRY=0"
Const DB_Lang_Czech = ";LANGID=0x0405;CP=1250;COUNTRY=0"
Const DB_Lang_Dutch = ";LANGID=0x0413;CP=1252;COUNTRY=0"
Const DB_Lang_Greek = ";LANGID=0x0408;CP=1253;COUNTRY=0"
Const DB_Lang_Hebrew = ";LANGID=0x040D;CP=1255;COUNTRY=0"
Const DB_Lang_Hungarian = ";LANGID=0x040E;CP=1250;COUNTRY=0"
Const DB_Lang_Icelandic = ";LANGID=0x040F;CP=1252;COUNTRY=0"
Const DB_Lang_Korean = ";LANGID=0x0412;CP=949;COUNTRY=0"
Const DB_Lang_Nordic = ";LANGID=0x041D;CP=1252;COUNTRY=0"
Const DB_Lang_NorwDan = ";LANGID=0x0406;CP=1252;COUNTRY=0" 'Norway and Dennmark
Const DB_Lang_Polish = ";LANGID=0x0415;CP=1250;COUNTRY=0"
Const DB_Lang_Slovenian = ";LANGID=0x0424;CP=1250;COUNTRY=0"
Const DB_Lang_Spanish = ";LANGID=0x040A;CP=1252;COUNTRY=0"
Const DB_Lang_SwedFin = ";LANGID=0x041D;CP=1252;COUNTRY=0"
Const DB_Lang_Thai = ";LANGID=0x041E;CP=874;COUNTRY=0"
Const DB_Lang_Turkish = ";LANGID=0x041F;CP=1254;COUNTRY=0"
Const DB_OPEN_DYNASET = 2
Const DB_APPEND_ONLY = 8
Const DRIVE_NAME = "E:\"
Const FILE_NAME = "TEST97.mdb"
Const oldFile = "E:\test97.mdb"
Const NewFile = "E:\test2000_2003.mdb"
Const cnsDbVersion30_AC95_AC97_Jet30_Jet35 = 32
Const cnsDbVersion20_AC20_Jet20 = 16
Const cndDBVerion10 =1
Dim dbe : Set dbe = CreateObject("DAO.DBEngine.36")
' MDB Start Making...
Set dbe = CreateObject("DAO.DBEngine.36")
Set db = dbe.CreateDatabase(DRIVE_NAME & FILE_NAME, DB_Lang_General, cnsDbVersion30_AC95_AC97_Jet30_Jet35)
Set db = Nothing
Set dbe = Nothing
Call JetCompact
End Sub
Sub JetCompact()
Dim JIRO : Set JIRO = CreateObject("JRO.JetEngine")
Dim strOldConnect : strOldConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & oldFile & ";"
Dim strNewConnect : strNewConnect ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & NewFile & ";Jet OLEDB:Engine Type =5;"
With CreateObject("Scripting.FileSystemObject")
If .FileExists(oldFIle)=False then Wscript.Quit
If .FileExists(NewFile)=True then Wscript.Quit
End With
JIRO.CompactDatabase strOldConnect, strNewConnect
Set Jiro = Nothing
WScript.Echo "Success End"
End Sub
Upvotes: 0
Reputation: 14039
This isn't an artefact of opening it in MS Access 2003? Sources do indeed seem to indicate engine type 4 is correct for Access 97.
Edit: apparently, Engine Type 4 is valid for both Access 95/97. I'll have another look.
Edit 2: What JET version are you using? 3.0 is associated with an Access 95 db, 3.5(1) with 97.
Upvotes: 0