Neven asked:
> When Opening a Project is there any way to Autoload datamodules
>
> I have this problem every time i migrate my TDatabase to a
> Datamodule I find that if I want to leave my queries active
> then I error everytime i load the project - it's a pain
After struggling with this issue over three years ago the NewLook/Profax
team decided that the only way to solve this problem was to always have a
database available during design time.
We achieved this by creating a global database variable. At runtime this
is initialised during the normal application/company code and as the
various data modules are loaded the database if therefore available as
expected.
For design time we created a small expert that watches for when a project
opens, and when it does it checks uses registry entires (based off the
projects name) to see what development database type to open (and how) and
this is used to initialise the global database variable that is then
available for design time work. The expert also add a a menu item that
allows developer access to set the type and access properties for the
database to use.
By doing this we have eliminated all the issues that arise from wanting to
have active tables at design time, and this trick has worked with BDE
datanses, IB Objects databases and now with our own private database
engine. Why Borland have never created a similar design time environment
controling facility I don't know, but I guess that most developers are
prepared to suffer in silence rather than fixed the problem or grumping at
Borland to do so.
Cheers, Max.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz