Board index » delphi » Multiples instances of a DataModules
Alvaro Boldo
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Alvaro Boldo
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Multiples instances of a DataModules
Hi
We have a lot o DataModules in our project and we want to share between Our problem is that when we are sharing a DataSet it could be modified We try to convert each DataModule into a true TClass but it is too Are we going in the wrong way? Thanks Alvaro |
Greg Washbur
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Multiples instances of a DataModulesQuoteyou wrote: Why do you share DataModules? I share a few DataModules for real short SELECT's or INSERT's, etc; but they have no lifespan. I try to stay away from anything global (shared). eGreg Alvaro Boldo <abo...@sorteotec.mty.itesm.mx> wrote in article Quote> Hi |
J.W. de Bok
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Multiples instances of a DataModulesYou can give the inheritence a try. I did it, but only for a kind of lookup datasets, not for editable datasets. J.W. de Bokx QuoteAlvaro Boldo wrote in message <39C97610.97EE8...@sorteotec.mty.itesm.mx>... |
Dan Palle
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Multiples instances of a DataModulesYou could create instances of the data module dynamically as needed. You'd have to manually adjust references to the data module from other forms, but this will allow you to do what you want. Dan QuoteAlvaro Boldo <abo...@sorteotec.mty.itesm.mx> wrote in message Quote> Hi |
Blaine Whittl
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Multiples instances of a DataModulesWell I don't know exactly what your doing so forgive me if I'm a little bit off on any of this. It's normally bad design to have any 2 forms / grids pointing to the same dataset. This is fine for small projects but when you start working with 400 forms then you don't want to have to track down why one dataset is behaving strangly. Now if you want dataset reuse there are a couple of options. One you can Something that actually seems to be backwards, but works rather well, is Just some thoughts. Blaine Whittle Quote"Alvaro Boldo" <abo...@sorteotec.mty.itesm.mx> wrote in message Quote> Hi |
Alvaro Bold
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Multiples instances of a DataModulesOk, I think I got it if we only talk about DataSet but, what about TSession, TQuery, TStoreProcedures ? I have a data module with just one TQuery and I reuse it in a lot of methods whitin the DataModule. Please, check my code and tell me if I'm going wrong. Example unit UAtomoDM1; interface uses type end; implementation uses UInicioSesionDM; {$R *.DFM} ////////////////////////////////////////////////////////////////////////// unit UMedioVentaDM ; interface uses type implementation uses UPadreDM, UInicioSesionDM; {$R *.DFM} UPadreDM.PadreDM.LeeDB(OracleQuery1); |
Alvaro Bold
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Multiples instances of a DataModulesSo... what code you think I use in a DataModule? where do I must this code, in a DataModule or in a Unit or what? I need to reuse this kind of querys. Function TMedioVentaDM.getNombreMedioVenta(qryMiObjeto: TOracleQuery; UPadreDM.PadreDM.LeeDB(OracleQuery1); QuoteBlaine Whittle wrote: |
Tomislav Kard
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Multiples instances of a DataModulesHi Blaine! On Thu, 21 Sep 2000 11:27:29 -0700, "Blaine Whittle" Quote<blai...@aproposretail.com> wrote: dataset is a kind of a must in some situations. Consider one form as a query form, where you can modify what selection data scope you want to see, there is a grid and you browse through data. Then, when you want to see one record in detail, you double click in the grid and another form shows up the same record in detail. There you can modify the record, enter new records, etc. So there you have two forms operating on the same dataset. In this situation I use naming convention like: <prefix>Data - Data module for all the database access and logic So, having same prefix they all line up together in project manager Quote>Something that actually seems to be backwards, but works rather well, is forms. Now, after some years of experience I use both... Dataset's that are ment for data entry I separate in datamodule and those dataset's that are ment only for viewing on some view only forms I put on the forms itself. Why I do like that? Because of my QMR i SR forms! Now I can link only Also, in my apps forms that are not shown are destroyed automaticaly. tomi. |
1. allowing Multiple instance of a dataModule
2. Creating multiple instance of Datamodule.
3. DataModule Multiple Instance
4. Multiple use of single instance accross multiple machines
5. Create multi instances of datamodule
6. Multiple views of the same DataModule
7. Multiple EXEs using same datamodule
8. ADOconnections and multiple datamodules