473,426 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,426 software developers and data experts.

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.05a"

Any thoughts would be appreciated. Thanks Anton

Dec 3 '05 #1
6 1651
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Peter Kaptein | last post by:
I am building websites using Databases and COM for 3tier apps. Currently I have to tell my COM object where the database is located either 1) Hardcoded in the DLL 2) Via my ASP call How do...
6
by: Salvani Langosta | last post by:
In an Access 97 database, I use serveral global variables that hold information about the database, for example: gstrFileServer - holds the server root where the database is stored...
3
by: Dalan | last post by:
I need some assistance or advise in composing code for a global function module or a related one for populating values in text boxes on reports and forms with a name, actually several different...
38
by: MLH | last post by:
I have 2 global constants declared in the same global module: Global Const MY_VERSION$ = "1.04" Global Const ProjectName$ = "MyProj" I have 2 global procedures designed to return the value of...
8
by: Thomas Coleman | last post by:
Ok, I've obviously discovered that Global.aspx has been completely changed in ..NET 2.0. However, I haven't figured out how to declare a constant that's available to any page in my application...
13
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end...
1
by: ahujasatna | last post by:
Hi all!! i am working on C#, ASP.Net with Sql server2000 and i am facing a problem, my Question is: "How to insert and retrieve images to/from Sqlserver2000 Database" I created a table...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
5
by: baburmm | last post by:
Hai, I want to get the Global static name(for Constant) Declared in the Global.asax file for my whole project as a constant. my coding in the Global.asax file is private static string strName =...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.