473,396 Members | 2,011 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,396 software developers and data experts.

How to change conditional compiler constants using VBA?

I use conditional compiler constants, set through the VBA IDE in
Tools, <projectname> Properties, that I refer to throughout my code to
control which code is used during development, and which during
production. Usually, this only wraps code used to control quitting
the whole app versus just shutting a form, but it can also control
many other things.

However, as part of the build before delivering an update, I have to
remember to change the CC constants, as well as run code to set menu
and command bars for all the forms and reports, remove default project
properties to inhibit user access, recompile, then build a .MDE ready
to deliver.

I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in
the code, nor by using them in a command line in the shortcut to run
the app.

Any ideas?

TIA

Andrew
Nov 12 '05 #1
13 6043
> properties to inhibit user access, recompile, then build a .MDE ready
to deliver. I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in
My experience was that MDE's could not see CC constants defined
as project properties in the IDE when the build was scripted using
syscmd 603. Have you tried this? Which version of Access are you
using?

(david)

=========================================
"Andrew" <an**************************@bigpond.com> wrote in message
news:cb*************************@posting.google.co m... I use conditional compiler constants, set through the VBA IDE in
Tools, <projectname> Properties, that I refer to throughout my code to
control which code is used during development, and which during
production. Usually, this only wraps code used to control quitting
the whole app versus just shutting a form, but it can also control
many other things.

However, as part of the build before delivering an update, I have to
remember to change the CC constants, as well as run code to set menu
and command bars for all the forms and reports, remove default project
properties to inhibit user access, recompile, then build a .MDE ready
to deliver.

I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in
the code, nor by using them in a command line in the shortcut to run
the app.

Any ideas?

TIA

Andrew

Nov 12 '05 #2
Hi David,

syscmd 603? I know syscmd acSysCmdRuntime (which = 6).

This is running under Access 2k, A2k runtime, and AXP. The .MDE seems to be
handling the CCs no problem, as long as I remember to recompile after
setting them.

Andrew

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
properties to inhibit user access, recompile, then build a .MDE ready
to deliver.

I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in


My experience was that MDE's could not see CC constants defined
as project properties in the IDE when the build was scripted using
syscmd 603. Have you tried this? Which version of Access are you
using?

(david)

=========================================
"Andrew" <an**************************@bigpond.com> wrote in message
news:cb*************************@posting.google.co m...
I use conditional compiler constants, set through the VBA IDE in
Tools, <projectname> Properties, that I refer to throughout my code to
control which code is used during development, and which during
production. Usually, this only wraps code used to control quitting
the whole app versus just shutting a form, but it can also control
many other things.

However, as part of the build before delivering an update, I have to
remember to change the CC constants, as well as run code to set menu
and command bars for all the forms and reports, remove default project
properties to inhibit user access, recompile, then build a .MDE ready
to deliver.

I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in
the code, nor by using them in a command line in the shortcut to run
the app.

Any ideas?

TIA

Andrew


Nov 12 '05 #3
appobj.syscmd 603 "sfile1", "sfile2"

is one of the ways of making an MDE from an MDB.

it does not require that you have the mdb as the current
database, which is probably why it looses the conditional
compile constants.

Are you scripting the 'make mde' phase of your build?
If so, which method are you using?

(david)
"Hopeful" <Li**@in.hope> wrote in message
news:7H******************@news-server.bigpond.net.au...
Hi David,

syscmd 603? I know syscmd acSysCmdRuntime (which = 6).

This is running under Access 2k, A2k runtime, and AXP. The .MDE seems to be handling the CCs no problem, as long as I remember to recompile after
setting them.

Andrew

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
properties to inhibit user access, recompile, then build a .MDE ready
to deliver.

I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in


My experience was that MDE's could not see CC constants defined
as project properties in the IDE when the build was scripted using
syscmd 603. Have you tried this? Which version of Access are you
using?

(david)

=========================================
"Andrew" <an**************************@bigpond.com> wrote in message
news:cb*************************@posting.google.co m...
I use conditional compiler constants, set through the VBA IDE in
Tools, <projectname> Properties, that I refer to throughout my code to
control which code is used during development, and which during
production. Usually, this only wraps code used to control quitting
the whole app versus just shutting a form, but it can also control
many other things.

However, as part of the build before delivering an update, I have to
remember to change the CC constants, as well as run code to set menu
and command bars for all the forms and reports, remove default project
properties to inhibit user access, recompile, then build a .MDE ready
to deliver.

I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in
the code, nor by using them in a command line in the shortcut to run
the app.

Any ideas?

TIA

Andrew



Nov 12 '05 #4
Ah, that's a useful command.

No, I'd not got as far as scripting the 'Make .MDE'. The steps that I take
as standard are:
0. Update version information using a hidden local table and hidden form,
that then exports a version history text file to include in the set-up
1. run procedure to apply custom toolbars/menubars to forms and reports
(never use macros...uuggh!)
2. run procedure to switch off all database properties that allow the user
to get behind the scenes
3. manually change the CC constant(s)
4. recompile (occasionally I'll precede the whole shebang with a command
line decompile as well to clean out the file)
5. manually run 'Make .mde'

After the 'Make .mde' the app reopens now paying attention to the new CC
constants, and behaving as it should in production.

All the routines are run using an AutoKeys shortcut that calls a single
wrapper routine that starts with a message box to allow you to toggle things
on or off, and passes this on to the other routines. This allows me to get
back in to the mdb to carry on with the next round of work.

The whole lot then gets pulled together with any supporting files, usually
using Inno setup (or the dread P & D wizard for runtime installations until
I can figure out an Inno script for the runtime files). Since it's the .mde
is delivered, of course there's not a load that the user can do should the
stumble across the AutoKeys shortcut, and the message encourages them to
cancel anyhow. The worst that could happen is that they might manage to
break into code, and for the user base I'm dealing with, that's not a
threat!

I've written a small VB app that wraps up the decompile process, and I was
thinking it might be possible to write another to wrap up the entire build
process. So the first step would be to work out how to change the CC
constants, then recompile, then 'Make .mde' all from outside. It would be a
very handy tool if I can pull it off.

Where did you come across the syscmd 603? Do you know of any other
undocumented syscmd tricks?

Here's me asking for all your secrets - sorry! Still, if you don't ask...

All the best,

Andrew

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
appobj.syscmd 603 "sfile1", "sfile2"

is one of the ways of making an MDE from an MDB.

it does not require that you have the mdb as the current
database, which is probably why it looses the conditional
compile constants.

Are you scripting the 'make mde' phase of your build?
If so, which method are you using?

(david)
"Hopeful" <Li**@in.hope> wrote in message
news:7H******************@news-server.bigpond.net.au...
Hi David,

syscmd 603? I know syscmd acSysCmdRuntime (which = 6).

This is running under Access 2k, A2k runtime, and AXP. The .MDE seems
to be
handling the CCs no problem, as long as I remember to recompile after
setting them.

Andrew

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
> properties to inhibit user access, recompile, then build a .MDE ready > to deliver.

> I'd really like to automate the build, and the one step I can't crack > is setting the CC constant. No, I don't want to set them inline in

My experience was that MDE's could not see CC constants defined
as project properties in the IDE when the build was scripted using
syscmd 603. Have you tried this? Which version of Access are you
using?

(david)

=========================================
"Andrew" <an**************************@bigpond.com> wrote in message
news:cb*************************@posting.google.co m...
> I use conditional compiler constants, set through the VBA IDE in
> Tools, <projectname> Properties, that I refer to throughout my code to > control which code is used during development, and which during
> production. Usually, this only wraps code used to control quitting
> the whole app versus just shutting a form, but it can also control
> many other things.
>
> However, as part of the build before delivering an update, I have to
> remember to change the CC constants, as well as run code to set menu
> and command bars for all the forms and reports, remove default project > properties to inhibit user access, recompile, then build a .MDE ready > to deliver.
>
> I'd really like to automate the build, and the one step I can't crack > is setting the CC constant. No, I don't want to set them inline in
> the code, nor by using them in a command line in the shortcut to run
> the app.
>
> Any ideas?
>
> TIA
>
> Andrew



Nov 12 '05 #5
On 1 Mar 2004 06:16:38 -0800, an**************************@bigpond.com
(Andrew) wrote:
I use conditional compiler constants, set through the VBA IDE in
Tools, <projectname> Properties, that I refer to throughout my code to
control which code is used during development, and which during
production. Usually, this only wraps code used to control quitting
the whole app versus just shutting a form, but it can also control
many other things.

However, as part of the build before delivering an update, I have to
remember to change the CC constants, as well as run code to set menu
and command bars for all the forms and reports, remove default project
properties to inhibit user access, recompile, then build a .MDE ready
to deliver.

I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in
the code, nor by using them in a command line in the shortcut to run
the app.

Any ideas?

TIA

Andrew


In addition to other comments, I wanted to add something I've learned in my
own coding process. I've had some troubles with precompiler constants, and I
found some alternative schemes I now tend to prefer.

Problems:
1. Sometimes, precompiler conditional code can be really messy, especially
when it overlaps some standard VBA conditional code.
2. Sometimes the editor can get really confused.
3. Sometimes, it messes up Decompile.

Alternatives:
1. Use standard VBA conditions. In most cases, the performance hit is
immesurably small.
2. Create standard and stub versions of optional code, and comment out the
standard or stub version as desired.

Nov 12 '05 #6
"Andrew" <an**************@webster.org> wrote in
news:LG******************@news-server.bigpond.net.au:
Where did you come across the syscmd 603? Do you know of any other
undocumented syscmd tricks?


This is a Klingon discovery. As a real programmer, you would not want to use
it?

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #7
Hmmm.

Make it so.

"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"Andrew" <an**************@webster.org> wrote in
news:LG******************@news-server.bigpond.net.au:
Where did you come across the syscmd 603? Do you know of any other
undocumented syscmd tricks?
This is a Klingon discovery. As a real programmer, you would not want to

use it?

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)

Nov 12 '05 #8
Hi Steve,

Thanks for joining in.

You've got me thinking. What I want to do is simply flip a flag somewhere,
so that in 'Developer mode' certain code runs (e.g. DoCmd.Close instead of
DoCmd.Quit), while in 'Production mode' other code runs (e.g. DoCmd.Quit
instead of DoCmd.Close). There are usually a couple of other things spread
out around the code, so CC constants seem to provide a one-stop-shop for
turning them all on or off.

However, what I could do, so it can be done from code, is add a Custom
Database Property (or more than one), and flip that at the same time as I'm
running all the other database property code to enable/disable user access
to the clever stuff behind the scenes. Then wrap the conditional code with
a test that checks the state of the property, rather than a load of #If's.
If I was feeling particularly bright, I might make the property an integer
and using bitwise comparison to set/test several values at the same time.

Hmmm.

I'll have to go and experiment.

However, it's late now here in Oz, so I'm going to leave it until tomorrow.

All the best,

Andrew

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:cl********************************@4ax.com...
On 1 Mar 2004 06:16:38 -0800, an**************************@bigpond.com
(Andrew) wrote:
I use conditional compiler constants, set through the VBA IDE in
Tools, <projectname> Properties, that I refer to throughout my code to
control which code is used during development, and which during
production. Usually, this only wraps code used to control quitting
the whole app versus just shutting a form, but it can also control
many other things.

However, as part of the build before delivering an update, I have to
remember to change the CC constants, as well as run code to set menu
and command bars for all the forms and reports, remove default project
properties to inhibit user access, recompile, then build a .MDE ready
to deliver.

I'd really like to automate the build, and the one step I can't crack
is setting the CC constant. No, I don't want to set them inline in
the code, nor by using them in a command line in the shortcut to run
the app.

Any ideas?

TIA

Andrew
In addition to other comments, I wanted to add something I've learned in

my own coding process. I've had some troubles with precompiler constants, and I found some alternative schemes I now tend to prefer.

Problems:
1. Sometimes, precompiler conditional code can be really messy, especially when it overlaps some standard VBA conditional code.
2. Sometimes the editor can get really confused.
3. Sometimes, it messes up Decompile.

Alternatives:
1. Use standard VBA conditions. In most cases, the performance hit is
immesurably small.
2. Create standard and stub versions of optional code, and comment out the standard or stub version as desired.

Nov 12 '05 #9
Let us know how that goes.

On Wed, 03 Mar 2004 13:17:48 GMT, "Andrew" <an**************@webster.org>
wrote:
Hi Steve,

Thanks for joining in.

You've got me thinking. What I want to do is simply flip a flag somewhere,
so that in 'Developer mode' certain code runs (e.g. DoCmd.Close instead of
DoCmd.Quit), while in 'Production mode' other code runs (e.g. DoCmd.Quit
instead of DoCmd.Close). There are usually a couple of other things spread
out around the code, so CC constants seem to provide a one-stop-shop for
turning them all on or off.

However, what I could do, so it can be done from code, is add a Custom
Database Property (or more than one), and flip that at the same time as I'm
running all the other database property code to enable/disable user access
to the clever stuff behind the scenes. Then wrap the conditional code with
a test that checks the state of the property, rather than a load of #If's.
If I was feeling particularly bright, I might make the property an integer
and using bitwise comparison to set/test several values at the same time.

Hmmm.

I'll have to go and experiment.

However, it's late now here in Oz, so I'm going to leave it until tomorrow.

All the best,

Andrew

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:cl********************************@4ax.com.. .
On 1 Mar 2004 06:16:38 -0800, an**************************@bigpond.com
(Andrew) wrote:
>I use conditional compiler constants, set through the VBA IDE in
>Tools, <projectname> Properties, that I refer to throughout my code to
>control which code is used during development, and which during
>production. Usually, this only wraps code used to control quitting
>the whole app versus just shutting a form, but it can also control
>many other things.
>
>However, as part of the build before delivering an update, I have to
>remember to change the CC constants, as well as run code to set menu
>and command bars for all the forms and reports, remove default project
>properties to inhibit user access, recompile, then build a .MDE ready
>to deliver.
>
>I'd really like to automate the build, and the one step I can't crack
>is setting the CC constant. No, I don't want to set them inline in
>the code, nor by using them in a command line in the shortcut to run
>the app.
>
>Any ideas?
>
>TIA
>
>Andrew


In addition to other comments, I wanted to add something I've learned in

my
own coding process. I've had some troubles with precompiler constants,

and I
found some alternative schemes I now tend to prefer.

Problems:
1. Sometimes, precompiler conditional code can be really messy,

especially
when it overlaps some standard VBA conditional code.
2. Sometimes the editor can get really confused.
3. Sometimes, it messes up Decompile.

Alternatives:
1. Use standard VBA conditions. In most cases, the performance hit is
immesurably small.
2. Create standard and stub versions of optional code, and comment out

the
standard or stub version as desired.


Nov 12 '05 #10
You can make an mde by selecting from the menu, or by using
the syscmd, or by using SendKeys. And you MIGHT be able to
automate the actual menu item, using the menu object:
infinitely better than SendKeys, and that would enable you
to use the CCC's

I got the syscmd constant from the newsgroups (microsoft.public
..access.modulesdaovba): now I pass it on to you :~) I think
that Dan Haught (FMS) is credited with the first documentation
of Syscmd 603. He got it from one of the Microsoft Access
Wizards or from examination of the exe/dll entry points.

Regarding Conditional Compile: It works slightly differently
in A2K than in A97, but after compilation it is much more stable
than using a flag! At least when you are debugging, you know
which branch you are in! Not like a variable, accidentally
cleared during debugging by hitting 'end' on an error message.

And if you use a database property or table value, make sure
there is no code that will accidentally clear it if a transient
variable has the wrong value!
(david)

"Andrew" <an**************@webster.org> wrote in message
news:LG******************@news-server.bigpond.net.au...
Ah, that's a useful command.

No, I'd not got as far as scripting the 'Make .MDE'. The steps that I take as standard are:
0. Update version information using a hidden local table and hidden form,
that then exports a version history text file to include in the set-up
1. run procedure to apply custom toolbars/menubars to forms and reports
(never use macros...uuggh!)
2. run procedure to switch off all database properties that allow the user
to get behind the scenes
3. manually change the CC constant(s)
4. recompile (occasionally I'll precede the whole shebang with a command
line decompile as well to clean out the file)
5. manually run 'Make .mde'

After the 'Make .mde' the app reopens now paying attention to the new CC
constants, and behaving as it should in production.

All the routines are run using an AutoKeys shortcut that calls a single
wrapper routine that starts with a message box to allow you to toggle things on or off, and passes this on to the other routines. This allows me to get back in to the mdb to carry on with the next round of work.

The whole lot then gets pulled together with any supporting files, usually
using Inno setup (or the dread P & D wizard for runtime installations until I can figure out an Inno script for the runtime files). Since it's the ..mde is delivered, of course there's not a load that the user can do should the
stumble across the AutoKeys shortcut, and the message encourages them to
cancel anyhow. The worst that could happen is that they might manage to
break into code, and for the user base I'm dealing with, that's not a
threat!

I've written a small VB app that wraps up the decompile process, and I was
thinking it might be possible to write another to wrap up the entire build
process. So the first step would be to work out how to change the CC
constants, then recompile, then 'Make .mde' all from outside. It would be a very handy tool if I can pull it off.

Where did you come across the syscmd 603? Do you know of any other
undocumented syscmd tricks?

Here's me asking for all your secrets - sorry! Still, if you don't ask...

All the best,

Andrew

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
appobj.syscmd 603 "sfile1", "sfile2"

is one of the ways of making an MDE from an MDB.

it does not require that you have the mdb as the current
database, which is probably why it looses the conditional
compile constants.

Are you scripting the 'make mde' phase of your build?
If so, which method are you using?

(david)
"Hopeful" <Li**@in.hope> wrote in message
news:7H******************@news-server.bigpond.net.au...
Hi David,

syscmd 603? I know syscmd acSysCmdRuntime (which = 6).

This is running under Access 2k, A2k runtime, and AXP. The .MDE seems to
be
handling the CCs no problem, as long as I remember to recompile after
setting them.

Andrew

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
> > properties to inhibit user access, recompile, then build a .MDE
ready > > to deliver.
>
> > I'd really like to automate the build, and the one step I can't crack > > is setting the CC constant. No, I don't want to set them inline in >
> My experience was that MDE's could not see CC constants defined
> as project properties in the IDE when the build was scripted using
> syscmd 603. Have you tried this? Which version of Access are you
> using?
>
> (david)
>
> =========================================
> "Andrew" <an**************************@bigpond.com> wrote in message
> news:cb*************************@posting.google.co m...
> > I use conditional compiler constants, set through the VBA IDE in
> > Tools, <projectname> Properties, that I refer to throughout my code to
> > control which code is used during development, and which during
> > production. Usually, this only wraps code used to control
quitting > > the whole app versus just shutting a form, but it can also control
> > many other things.
> >
> > However, as part of the build before delivering an update, I have to > > remember to change the CC constants, as well as run code to set menu > > and command bars for all the forms and reports, remove default

project > > properties to inhibit user access, recompile, then build a .MDE ready > > to deliver.
> >
> > I'd really like to automate the build, and the one step I can't crack > > is setting the CC constant. No, I don't want to set them inline in > > the code, nor by using them in a command line in the shortcut to run > > the app.
> >
> > Any ideas?
> >
> > TIA
> >
> > Andrew
>
>



Nov 12 '05 #11
Well I did a bit of poking around the web and found the following
(attribution within quote)
#############################
Thanks to Jacques Soudan of www.troisj.com for this compilation of
undocumented constants for the SysCmd function:

SysCmd(7) 'Detects the Access VERSION number

For Access 97:

SysCmd 603, PathMdb, PathMde 'convert MDB -> MDE
SysCmd 602, PathMdb, PathMdb 'compact DB
SysCmd 555 'create MSysIMEX... tables
SysCmd(504, 16483) 'save and compile code
SysCmd(504, 16484) 'save code without compiling
SysCmd(501, i) 'list of references, i = 0, 1, ... n
SysCmd(500) 'count of references

For Access 2000+:

SysCmd 603, PathMdb, PathMde 'convert MDB -> MDE
SysCmd 602, PathMdb, PathMdb 'compact DB
'You must use in this case following method, example:
Dim accApp As Access.Application
Set accApp = New Access.Application
accApp.SysCmd 603, PathMdb, PathMde
accApp.SysCmd 602, PathMdb, PathMdb
Set accApp = Nothing
SysCmd(605, 0) 'convert DB to previous version
SysCmd(605, "C:\Database97.mdb") 'convert DB to previous version
SysCmd(607,"C:\Project1.adp") 'convert DB to ADP project
SysCmd(608, i) '60 tips about Access programming for i=0, 1, ... 60
SysCmd(710, 68486165) 'set Polish keyboard (if installed)
SysCmd(710, 67699721) 'set US keyboard
SysCmd(710, 68748313) 'set Russian keyboard
SysCmd(710, 67634184) 'set Greek keyboard
SysCmd(710, ...) 'set other country keyboard
SysCmd(710,1) 'set next installed keyboard
SysCmd(710,0) 'set previous installed keyboard
SysCmd(711) 'return put keyboard currently
SysCmd(714) 'returns TRUE, if any form, report, macro or module is in design
mode
SysCmd(715) 'returns Build number of MSACCESS.EXE file to check Access
version or e.g. which Service Pack is installed.
From Access Extra newsletter October 2003
############################

So that's covered my save and compile, and make MDE commands. Now I've just
got to make some time to sit down and write out all the code!

Andrew
"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
You can make an mde by selecting from the menu, or by using
the syscmd, or by using SendKeys. And you MIGHT be able to
automate the actual menu item, using the menu object:
infinitely better than SendKeys, and that would enable you
to use the CCC's

I got the syscmd constant from the newsgroups (microsoft.public
.access.modulesdaovba): now I pass it on to you :~) I think
that Dan Haught (FMS) is credited with the first documentation
of Syscmd 603. He got it from one of the Microsoft Access
Wizards or from examination of the exe/dll entry points.

Regarding Conditional Compile: It works slightly differently
in A2K than in A97, but after compilation it is much more stable
than using a flag! At least when you are debugging, you know
which branch you are in! Not like a variable, accidentally
cleared during debugging by hitting 'end' on an error message.

And if you use a database property or table value, make sure
there is no code that will accidentally clear it if a transient
variable has the wrong value!
(david)

"Andrew" <an**************@webster.org> wrote in message
news:LG******************@news-server.bigpond.net.au...
Ah, that's a useful command.

No, I'd not got as far as scripting the 'Make .MDE'. The steps that I take
as standard are:
0. Update version information using a hidden local table and hidden form,
that then exports a version history text file to include in the set-up
1. run procedure to apply custom toolbars/menubars to forms and reports
(never use macros...uuggh!)
2. run procedure to switch off all database properties that allow the user to get behind the scenes
3. manually change the CC constant(s)
4. recompile (occasionally I'll precede the whole shebang with a command
line decompile as well to clean out the file)
5. manually run 'Make .mde'

After the 'Make .mde' the app reopens now paying attention to the new CC
constants, and behaving as it should in production.

All the routines are run using an AutoKeys shortcut that calls a single
wrapper routine that starts with a message box to allow you to toggle

things
on or off, and passes this on to the other routines. This allows me to

get
back in to the mdb to carry on with the next round of work.

The whole lot then gets pulled together with any supporting files, usually using Inno setup (or the dread P & D wizard for runtime installations

until
I can figure out an Inno script for the runtime files). Since it's the

.mde
is delivered, of course there's not a load that the user can do should the stumble across the AutoKeys shortcut, and the message encourages them to
cancel anyhow. The worst that could happen is that they might manage to
break into code, and for the user base I'm dealing with, that's not a
threat!

I've written a small VB app that wraps up the decompile process, and I was thinking it might be possible to write another to wrap up the entire build process. So the first step would be to work out how to change the CC
constants, then recompile, then 'Make .mde' all from outside. It would be a
very handy tool if I can pull it off.

Where did you come across the syscmd 603? Do you know of any other
undocumented syscmd tricks?

Here's me asking for all your secrets - sorry! Still, if you don't
ask...
All the best,

Andrew

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
appobj.syscmd 603 "sfile1", "sfile2"

is one of the ways of making an MDE from an MDB.

it does not require that you have the mdb as the current
database, which is probably why it looses the conditional
compile constants.

Are you scripting the 'make mde' phase of your build?
If so, which method are you using?

(david)
"Hopeful" <Li**@in.hope> wrote in message
news:7H******************@news-server.bigpond.net.au...
> Hi David,
>
> syscmd 603? I know syscmd acSysCmdRuntime (which = 6).
>
> This is running under Access 2k, A2k runtime, and AXP. The .MDE seems
to
be
> handling the CCs no problem, as long as I remember to recompile

after > setting them.
>
> Andrew
>
> "david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message > news:40***********************@news.syd.swiftdsl.c om.au...
> > > properties to inhibit user access, recompile, then build a .MDE

ready
> > > to deliver.
> >
> > > I'd really like to automate the build, and the one step I can't

crack
> > > is setting the CC constant. No, I don't want to set them inline

in > >
> > My experience was that MDE's could not see CC constants defined
> > as project properties in the IDE when the build was scripted using
> > syscmd 603. Have you tried this? Which version of Access are you
> > using?
> >
> > (david)
> >
> > =========================================
> > "Andrew" <an**************************@bigpond.com> wrote in message > > news:cb*************************@posting.google.co m...
> > > I use conditional compiler constants, set through the VBA IDE in
> > > Tools, <projectname> Properties, that I refer to throughout my code
to
> > > control which code is used during development, and which during
> > > production. Usually, this only wraps code used to control

quitting > > > the whole app versus just shutting a form, but it can also control > > > many other things.
> > >
> > > However, as part of the build before delivering an update, I
have to > > > remember to change the CC constants, as well as run code to set menu > > > and command bars for all the forms and reports, remove default

project
> > > properties to inhibit user access, recompile, then build a .MDE

ready
> > > to deliver.
> > >
> > > I'd really like to automate the build, and the one step I can't

crack
> > > is setting the CC constant. No, I don't want to set them inline in > > > the code, nor by using them in a command line in the shortcut to run > > > the app.
> > >
> > > Any ideas?
> > >
> > > TIA
> > >
> > > Andrew
> >
> >
>
>



Nov 12 '05 #12
"Andrew" <an**************@webster.org> wrote in
news:le******************@news-server.bigpond.net.au:
Well I did a bit of poking around the web and found the following
(attribution within quote)
############################# <snips> 'You must use in this case following method, example:
Dim accApp As Access.Application
Set accApp = New Access.Application
accApp.SysCmd 603, PathMdb, PathMde
accApp.SysCmd 602, PathMdb, PathMdb
Set accApp = Nothing
From Access Extra newsletter October 2003
############################ "david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
I got the syscmd constant from the newsgroups (microsoft.public
.access.modulesdaovba): now I pass it on to you :~) I think
that Dan Haught (FMS) is credited with the first documentation
of Syscmd 603. He got it from one of the Microsoft Access
Wizards or from examination of the exe/dll entry points.


Dan posted SysCmd 608 on September 11 1998.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #13
Hi Lyle,

Are you taking gingko? That's a hell of a memory you've got there!

Andrew
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"Andrew" <an**************@webster.org> wrote in
news:le******************@news-server.bigpond.net.au:
Well I did a bit of poking around the web and found the following
(attribution within quote)
#############################

<snips>
'You must use in this case following method, example:
Dim accApp As Access.Application
Set accApp = New Access.Application
accApp.SysCmd 603, PathMdb, PathMde
accApp.SysCmd 602, PathMdb, PathMdb
Set accApp = Nothing
From Access Extra newsletter October 2003
############################

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
I got the syscmd constant from the newsgroups (microsoft.public
.access.modulesdaovba): now I pass it on to you :~) I think
that Dan Haught (FMS) is credited with the first documentation
of Syscmd 603. He got it from one of the Microsoft Access
Wizards or from examination of the exe/dll entry points.


Dan posted SysCmd 608 on September 11 1998.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)

Nov 12 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joseph VanWagoner | last post by:
I want to know how to change the color and look of the <select> border. I wrote: SELECT { BORDER-COLOR:ORANGE; BORDER-STYLE:SOLID; BORDER-SIZE:2PX; } This works for everything, but <select>....
0
by: Victor Irzak | last post by:
Hello, I want to build two assemblies that use common c# code. I wish to use preprocessor. I defined a constant YABA in "Conditional compilation constants" in the property pages. So the line...
1
by: Benne Smith | last post by:
I can't seem to use my normal compiler constants from inside a macro ? It's possible to define NEW constants inside the macro, but this is not what i need. Does anybody know a way to get to...
10
by: Vladimir Kouznetsov | last post by:
#using <mscorlib.dll> #include <vcclr.h> public __gc class A {}; struct B { void f(A* e); gcroot<A*> e; }; int main() { B().f(new A()); // note that B b; b.f(new A)); works fine return 0;
3
by: Jigar Mehta | last post by:
Hye, I am Jigar Mehta, currently, I am using AfxMessageBox where I need to change the caption of the messagebox using that function only... What I get is, the project name as the caption. I don't...
1
by: martin | last post by:
Hi, I am having a little trouble defining compiler constants and picking then up in my code. In the configuration manger I defined the constant "Martin" I then set the Project Configuration...
0
by: Sam Marrocco | last post by:
Is there a way to prevent a conditional compiler directive from "disabling" my #region/End Region statements? If I surround a block of code that contains #region statements with an #if/#EndIf...
2
by: G.Ashok | last post by:
Hi, Is there any option/setting/attribute availble to detect the difference in the value specified for a Ccc on the build tab and used/given in the code? For example: DBEngine="Access" in...
1
by: Marc the Demi-Programmer | last post by:
I am overriding WncProc to make sure my form's location stays within specified parameters. Basically, it has to stay at the top of the screen and not be off to either of the sides. All that works...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.