Board index » delphi » Multiple datamodules sharing the same database D5Ent
Darian Miller
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Multiple datamodules sharing the same database D5Ent
If you create a new project, then add a datamodule_main, throw a database
component on it and configure it for MSSQL database (Driver name =mssql, params contains user/pw/database/server names), set it's database name property to 'DBMain' and successfully set it's connected property to true, now create another datamodule called datamodule_x and throw a table on it and set the database name property to 'DBMain', tablename to a valid table, and active property to True and it seems to work. Now close/save the project and then reopen it and bring up the datamodule_x and it throws a BDE error with unknown alias for DBMain. But, if you bring up datamodule_main and reset the connected property of the database to False (or True..it doesn't seem to matter) and switch back to datamodule_x and set the active property of the table to true it doesn't throw an error. This seems odd, like I'm cludging Delphi a bit and it's unsettling. It would probably work as long as I always remember to bring up the datamodule_main and reset it's active property first when in design mode. I've played with sessions and it seems to have the same problems when Suggestions? Thanks, Darian |