Solved

Converting Access2.0 to Access '97

Posted on 1998-09-21
4
235 Views
Last Modified: 2013-12-25
I am converting an appication from VB3 and Access2.0 to VB5 and Access'97.

How can I programatically determine the version of the database and if it is Access2.0 convert it to Access '97?
0
Comment
Question by:jd6762
  • 3
4 Comments
 
LVL 4

Accepted Solution

by:
trkcorp earned 100 total points
ID: 1496337
try the following code:

Dim db As Database
  Dim prpNew As Property
  Dim prpLoop As Property

  Set db = OpenDatabase("c:\YOURDIR\YOURFILE.mdb")

  With db
    ' Create and append user-defined property.
    Set prpNew = .CreateProperty()
    prpNew.Name = "UserDefined"
    prpNew.Type = dbText
    prpNew.Value = "This is a user-defined property."
    .Properties.Append prpNew

    ' Enumerate all properties of current database.
On Error Resume Next
Debug.Print "Properties of " & .Name
    For Each prpLoop In .Properties
      With prpLoop
        Debug.Print "    " & .Name
        Debug.Print "        Type: " & .Type
        Debug.Print "        Value: " & .Value
        Debug.Print "        Inherited: " & _
          .Inherited
      End With
    Next prpLoop

    ' Delete new property because this is a
    ' demonstration.
    .Properties.Delete "UserDefined"
  End With

You will see in your debug window that you will get a section named "AccessVersion".  The Value property will give you the exact version.  For example: value: 07.53
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 1496338
PS: 07.53 = Access 97 in my particular installation.
0
 

Author Comment

by:jd6762
ID: 1496339
Thanks for the code to determine the version.  If the version is Aceess 2.0 how can I programatically convert it to a Access '97 version.

I see VB commands to repair and compact the database but not to convert?
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 1496340
I know of no integral op code for converting mdb files from one version to another.  I assume you would like to know how to perform the "magic" conversion that Access itself does.  My advice would be to forget that.  Write code to read the 2.0 file and write the new 97 file.  You can use the tabledefs collection to determine field names and sizes, etc...  The subject is pretty complex and I do not have existing code to paste here that illustrates the entire process.  I do have an example program from a CD that came with a book that illustrates how to gather all of the necessary info to "map" a database. If you give me your E-Mail address I will be glad to forward it to you. The example outlines just about everything you should need to pull this off.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now