Solved

Converting Access2.0 to Access '97

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

813 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