Solved

Converting Access2.0 to Access '97

Posted on 1998-09-21
4
268 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 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