By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,576 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,576 IT Pros & Developers. It's quick & easy.

MDB file version

P: n/a
Dear all,

Is there any way which can let me tell the version of each MDB file?

As you know when Access loading an old version MDB file, it will
automatically prompt user if they want to upgrade it to higher version. I
wonder if it is same with DBF to use one byte in file header to label
version number.

Thanks.

--
Best regards,
RL
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Lurc,

Is this not complete an MS office Access related question.

In other words, can you explain to us the relation to the VBNet programma
language

Cor
Nov 21 '05 #2

P: n/a
I was thinking he might want to figure out the version of Access used to
create his MDB from within a .NET app?

I thought ServerVersion might do the trick, but it looks like that just
returns the version of OleDb you're using (most like 4.0.xxxx). It might be
stored in those hidden Access tables (SysACEs and such), but I couldn't find
anything on it specifically... You might just have to open the file for
binary reading and read in the header info. or something (sorry, I don't
have info on that either...)

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uE**************@tk2msftngp13.phx.gbl...
Lurc,

Is this not complete an MS office Access related question.

In other words, can you explain to us the relation to the VBNet programma
language

Cor

Nov 21 '05 #3

P: n/a
If you do figure it out, I'd love to know what you come up with. Thanks

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uE**************@tk2msftngp13.phx.gbl...
Lurc,

Is this not complete an MS office Access related question.

In other words, can you explain to us the relation to the VBNet programma
language

Cor

Nov 21 '05 #4

P: n/a
Lurc,

After googling around, I found a few programs that will provide the version
information for an MDB file:

http://www.aylott.com.au/software.htm

however, I'm assuming that you're looking for something to integrate into
your app, so with a few more googles, I found the following link:

http://msdn.microsoft.com/library/de...c_acFormat.asp

download the database, open it, and have a look at the module
"modSearchFiles" (specifically the RunGetFiles Sub).

As Michael thought, you'll need to do a binary read on the MDB file, but at
least now, with the info in module, you'll know what you're looking for, and
you can do it without calling an external app!

HTH

Lee

"Lurc" <lu*****@spam.hotmail.com> wrote in message
news:uh*************@TK2MSFTNGP15.phx.gbl...
Dear all,

Is there any way which can let me tell the version of each MDB file?

As you know when Access loading an old version MDB file, it will
automatically prompt user if they want to upgrade it to higher version. I
wonder if it is same with DBF to use one byte in file header to label
version number.

Thanks.

--
Best regards,
RL

Nov 21 '05 #5

P: n/a
Lurc,

I was bored, so I did a quick conversion of the code in the Access Module
and added it to a quick VB.NET app that looks at file info for a selected
file. Just create a project with a form, one button, one label, and one
listbox.

Imports System.Text.RegularExpressions
Imports System.IO

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim result As DialogResult = DBFile.ShowDialog
If result = Windows.Forms.DialogResult.OK Then
Label1.Text = DBFile.FileName
Dim Filever1 As FileVersionInfo =
FileVersionInfo.GetVersionInfo(DBFile.FileName)
Try
ListBox1.Items.Add("File Version: " +
Filever1.FileVersion.ToString)
ListBox1.Items.Add("Product Version: " +
Filever1.ProductVersion.ToString)
ListBox1.Items.Add("Major Part: " +
Filever1.FileMajorPart.ToString)
ListBox1.Items.Add("Minor Part: " +
Filever1.FileMinorPart.ToString)
ListBox1.Items.Add("Build Part: " +
Filever1.FileBuildPart.ToString)
ListBox1.Items.Add("Description: " +
Filever1.FileDescription.ToString)
ListBox1.Items.Add("Language: " +
Filever1.Language.ToString)
ListBox1.Items.Add("Build Part: " +
Filever1.ProductBuildPart.ToString)
ListBox1.Items.Add("Major Part: " +
Filever1.ProductMajorPart.ToString)
ListBox1.Items.Add("Minor Part: " +
Filever1.ProductMinorPart.ToString)
ListBox1.Items.Add("Private Part: " +
Filever1.ProductPrivatePart.ToString)
Catch
End Try
If Regex.IsMatch(DBFile.FileName, "MDB",
RegexOptions.IgnoreCase) Then
Dim fs As FileStream = New FileStream(DBFile.FileName,
FileMode.Open, FileAccess.Read)
Dim br As BinaryReader = New BinaryReader(fs)
Dim av, aver As String
Const VERSION_STRING_SIZE As Integer = 24
Const JET_2_VERSION_NUMBER_START As Integer = 1
Const JET_VERSION_NUMBER_START As Integer = 21
Const LENGTH As Integer = 1
av = br.ReadChars(VERSION_STRING_SIZE)
br.Close()
fs.Close()
If Chr(1) = Mid(av, JET_2_VERSION_NUMBER_START, LENGTH) Then
aver = "Access 2"
ElseIf Chr(0) = Mid(av, JET_VERSION_NUMBER_START, LENGTH)
Then
aver = "Access 97"
ElseIf Chr(1) = Mid(av, JET_VERSION_NUMBER_START, LENGTH)
Then
aver = "Access 2000/2002"
Else
aver = "Don't Know"
End If
ListBox1.Items.Add(aver)
End If
End If
End Sub
End Class

HTH
Lee

"Lurc" <lu*****@spam.hotmail.com> wrote in message
news:uh*************@TK2MSFTNGP15.phx.gbl...
Dear all,

Is there any way which can let me tell the version of each MDB file?

As you know when Access loading an old version MDB file, it will
automatically prompt user if they want to upgrade it to higher version. I
wonder if it is same with DBF to use one byte in file header to label
version number.

Thanks.

--
Best regards,
RL

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.