[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Converting Access2.0 to Access '97

Posted on 1998-09-21
4
Medium Priority
?
290 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 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…
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…
Suggested Courses

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