Retrieve global constant string from another database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anton

    #1

    Retrieve global constant string from another database

    Hi folks,
    Is there any way to retrieve a global declared constant from another
    database. I want to use it for version tracking purposes. The constant
    that I am after is and will remain in a static position in a module ie:

    Option Compare Database
    Option Explicit
    Global Const vProgVersion As String = "v2.1911.05 a"

    Any thoughts would be appreciated. Thanks Anton

  • S. van Beek

    #2
    Re: Retrieve global constant string from another database

    Anton,
    I think you are looking for the GUID "Global Unique IDentifier".
    For more details see the Aceess Help file.
    Regards,
    Simon


    "Anton" <antonric@gmail .com> schreef in bericht
    news:1133583915 .255170.255090@ g43g2000cwa.goo glegroups.com.. .[color=blue]
    > Hi folks,
    > Is there any way to retrieve a global declared constant from another
    > database. I want to use it for version tracking purposes. The constant
    > that I am after is and will remain in a static position in a module ie:
    >
    > Option Compare Database
    > Option Explicit
    > Global Const vProgVersion As String = "v2.1911.05 a"
    >
    > Any thoughts would be appreciated. Thanks Anton
    >[/color]







    Comment

    • Terry Kreft

      #3
      Re: Retrieve global constant string from another database

      If you write a function that exposes the value of the const you can then
      pick up the value using automation.

      Function ProgVersion() As String
      ProgVersion = vProgVersion
      End Function


      Of course at this point you can change the scope of the const to private as
      you can call the function within your application.

      --
      Terry Kreft



      "Anton" <antonric@gmail .com> wrote in message
      news:1133583915 .255170.255090@ g43g2000cwa.goo glegroups.com.. .[color=blue]
      > Hi folks,
      > Is there any way to retrieve a global declared constant from another
      > database. I want to use it for version tracking purposes. The constant
      > that I am after is and will remain in a static position in a module ie:
      >
      > Option Compare Database
      > Option Explicit
      > Global Const vProgVersion As String = "v2.1911.05 a"
      >
      > Any thoughts would be appreciated. Thanks Anton
      >[/color]


      Comment

      • Albert D. Kallal

        #4
        Re: Retrieve global constant string from another database

        Build a public function that returns the number

        Public Sub MyVer (v as string)

        v = vProgVersion

        end sub

        The problem is that you will have to use automation to "open" the
        database..and that means the start code will run....

        I believe you are looking for the "run" method of the application

        myAccessObjectA pp.run ("MyVer",vNu m)

        I think a better approach would to be build a single table + field that
        stores he version number. Then use a public function in place of a constant
        to grab this value. And, you can then use the dao opendatabase to get a
        reocrdet, and NOT have to have the startup code run as per the above
        example.


        --
        Albert D. Kallal (Access MVP)
        Edmonton, Alberta Canada
        pleaseNOOSpamKa llal@msn.com



        Comment

        • Anton

          #5
          Re: Retrieve global constant string from another database

          Thanks for your reply's...reali sing that there is always more than one
          way to skin a cat, (...mmmm sweet sweet cat), I will give it a go.
          Greatly appreciate your help and ideas. Thanks. Anton

          Comment

          • Anton

            #6
            Re: Retrieve global constant string from another database

            Thanks for your reply's...reali sing that there is always more than one
            way to skin a cat, (...mmmm sweet sweet cat), I will give it a go.
            Greatly appreciate your help and ideas. Thanks. Anton

            Comment

            • Chuck Grimsby

              #7
              Re: Retrieve global constant string from another database

              On Sat, 03 Dec 2005 18:19:44 GMT, "Albert D. Kallal" <kallal@msn.com >
              wrote:[color=blue]
              >The problem is that you will have to use automation to "open" the
              >database..an d that means the start code will run....[/color]

              Not necessarily...




              Personally, however, I'd just store the "version number" as a property
              of the database file itself, and that way you can get at it without
              even opening the database.


              --
              Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

              Comment

              Working...