Solved

Converting Access2.0 to Access '97

Posted on 1998-09-21
4
274 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…

738 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