By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,720 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

Retrieve global constant string from another database

P: n/a
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.05a"

Any thoughts would be appreciated. Thanks Anton

Dec 3 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Anton,
I think you are looking for the GUID "Global Unique IDentifier".
For more details see the Aceess Help file.
Regards,
Simon
"Anton" <an******@gmail.com> schreef in bericht
news:11**********************@g43g2000cwa.googlegr oups.com...
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.05a"

Any thoughts would be appreciated. Thanks Anton




Dec 3 '05 #2

P: n/a
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" <an******@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
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.05a"

Any thoughts would be appreciated. Thanks Anton

Dec 3 '05 #3

P: n/a
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

myAccessObjectApp.run ("MyVer",vNum)

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
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Dec 3 '05 #4

P: n/a
Thanks for your reply's...realising 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

Dec 3 '05 #5

P: n/a
Thanks for your reply's...realising 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

Dec 3 '05 #6

P: n/a
On Sat, 03 Dec 2005 18:19:44 GMT, "Albert D. Kallal" <ka****@msn.com>
wrote:
The problem is that you will have to use automation to "open" the
database..and that means the start code will run....


Not necessarily...

http://www.mvps.org/access/api/api0068.htm
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

Dec 4 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.