Function that will tell what version of Access is installed

We really need a function that can tell what Access is installed on the machine(97 or 2000) and what version. thanks


Comments

  • : We really need a function that can tell what Access is installed on the machine(97 or 2000) and what version. thanks

    :



    You need to set up a function to read the DATABSE properties, this will return the following info about the databse referenced

    '========== DATABASE PROPERTY AND VALUES =========

    '========= OBTAINED From DATABASE PROPERTIES =====

    'Name ***********************************

    'Connect

    'Transactions True

    'Updatable True

    'CollatingOrder 1033

    'QueryTimeout 60

    'Version 3#

    'RecordsAffected 0

    'ReplicaID

    'DesignMasterID

    'accessversion 7.53

    'Build 5903

    'Show Values Limit 1000

    'Show Values in Indexed 1

    'Show Values in Non-Indexed 1

    'Show Values in Remote 0



    Heres a sub that will do this (note I have commented out the dtabase name returned)



    Private Sub cmd01_Click()

    Dim strSQL As String

    Dim strtable As String

    Dim mydb As Database

    Dim MyPrp As Property

    Dim myrst As Recordset



    Set mydb = CurrentDb()

    strtable = "_TESTDatabasePropertiesAndValues" & Now()





    DoCmd.RunCommand acCmdDebugWindow



    'strSQL = "CREATE TABLE [" & strTable & "] ([ObjectType] TEXT (64), [ObjectName] TEXT (64));"



    strSQL = "CREATE TABLE [" & strtable & "] ([DataBaseProperty] TEXT (64), [DataBasePropertyValue] TEXT (128),[Source] text(8));"

    mydb.Execute (strSQL)



    Set myrst = mydb.OpenRecordset(strtable)





    Debug.Print "========= DATABASE PROPERTIES AND VALUES ========="



    For Each MyPrp In mydb.Properties ' Iterate through each element.

    On Error Resume Next

    Debug.Print MyPrp.Name & " " & MyPrp.Value



    With myrst

    .AddNew ' Add new record.

    !DataBaseProperty = MyPrp.Name 'str1 ' Add data.

    !DataBasePropertyValue = MyPrp.Value 'str2

    !Source = "DbasProp"

    .Update ' Save changes.

    End With

    Next





    Exit Sub

    end sub






    URL:http://www.accesswatch.co.uk

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories