What information does the API GetVersion() return

  • Thread starter Thread starter John Elmen
  • Start date Start date
J

John Elmen

I am not a programmer however I am having a problem with a
MS Access 97 module in a database. This module is a support
routine for a form which allows a user to input the name
and path of a database file containing tables to attach to.
In this module, a call is made to the GetVersion() API and
the user supplied path/name of the other access database,
that contains the tables, is passed as a parameter. For
example:

GetVersion(c:\databases\Sample_db.mdb)

The module in question then does a check on the "version"
number which is returned. I am trying to find out what the
returned "version" number refers to.

The value returned is being compared to a value of 4.62 and
if less than this value, returns an error message of sorts.
The test is failing and generating an error message on my
screen. I am trying to understand why the program is doing
this check in hopes of correcting the problem.

Any information would be a big help!!!!
 
John,

The GetVersion() API returns the current version number of Windows.
Public Declare Function GetVersion Lib "kernel32" () As Long

As you can see, it has No arguments, so
GetVersion(c:\databases\Sample_db.mdb) will simply generate an error.
Firstly because the API does not have arguments, and secondly, because you
can't pass a string without enclosing it in quotes.

I am inclined to think that you are not actually using the GetVersion() API,
but that the original programmer wrote a function of the same name, and
*that* function takes an argument. But what *that* function does, I have no
idea.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Back
Top