datamodule

Why would a module be unsavable until another module is loaded?

流过昼夜 提交于 2020-06-24 12:36:14
问题 Most of the units I work on rely on a Data Module. One of the most annoying things I come accross is an error message telling me Module X references another module and cannot be saved until Module Y is loaded. Now, I'm sure there is a very good reason why CheckNoFixups raises this error while trying to WriteRootStream , and fails to save what is in effect a Text file (and hopefully this isn't followed by Catastrophic Failure where I must then restart the IDE while still unable to save my work

How to create a DataModule in Delphi 10.1

前提是你 提交于 2020-01-16 17:55:31
问题 I tried to create a DataModule for my non visible components in my multi-device-application, but the app won't compile giving me the following error: 回答1: Well, I hadn't been working on this app for very long so I started over and I was able to create and use the Datamodule just file. Not sure what the issue was, but thanks, guys. I actually thought I found a bug. Well, I did. It was me 来源: https://stackoverflow.com/questions/40011841/how-to-create-a-datamodule-in-delphi-10-1

separate dataset instances using datamodules in delphi

杀马特。学长 韩版系。学妹 提交于 2019-12-19 10:05:36
问题 I am using Delphi6 and have a data module with an ADO DataSet which is used by two forms, formA and FormB. Each form has a Dataset.Open() in OnCreate and Dataset.Close() in OnClose . If both forms are open simultaneously and formB is closed the dataset is closed in formA. How can I prevent this, essentially I need separate instances of the dataset for each form but at the same time use the datamodule. 回答1: The simplest way to achieve what you want is to create an instance of the data module

Delphi: App initialization - best practices / approach

ぐ巨炮叔叔 提交于 2019-12-18 12:14:07
问题 I run into this regularly, and am just looking for best practice/approach. I have a database / datamodule-containing app, and want to fire up the database/datasets on startup w/o having "active at runtime" set to true at design time (database location varies). Also run a web "check for updates" routine when the app starts up. Given TForm event sequences, and results from various trial and error, I'm currently using this approach: I use a "Globals" record set up in the main form to store all

Access DataModule's event from another Form (delphi design-time)

こ雲淡風輕ζ 提交于 2019-12-13 09:11:50
问题 I would like to know if there's any way to link a component's event (As TButton.OnClick ) to a procedure defined in a datamodule (At design-time). At the moment, I'm doing this at runtime: MyButton.OnClick := MyDataModule.MyOnClickEvent; The goal would be that to get MyDataModule.MyOnClickEvent proposed in the dropdown lists in the Object Inspector Window. Thanks in advance to all who will share their knowledge :D Note1: Here's a similar question, but there are no informations about how to

Access an event on a DataModule from another Form

核能气质少年 提交于 2019-12-10 20:39:15
问题 In Delphi 2009 I have a Form with a procedure MyProcedure that writes to a label on the Form. The form uses a DataModule with a ClientDataSet. When the AfterScroll event of the ClientDataSet is fired MyProcedure should be executed. To avoid circular references and more important, as I want the DataModule to be reusable, the DataModule should not reference to this specific Form. In short, I hope that I can access the AfterScroll event from my Form. Can I hook up the Afterscroll event on the

Delphi style: How to structure data modules for unit-testable code?

微笑、不失礼 提交于 2019-12-09 04:21:20
问题 I am looking for some advice about structuring Delphi programs for maintainability. I've come to Delphi programming after a couple of decades of mostly C/C++ though I first learned to program with Turbo Pascal, so I'm not uncomfortable with the basic language. In my previous experience with C++ and C#, I became a TDD convert through using cxxtest and NUnit. I have inherited this program that I am now responsible for maintaining. It consists mainly of forms, and a couple of data modules. The

Drawing on a DataModule in Delphi

做~自己de王妃 提交于 2019-12-08 15:56:16
问题 I wonder how difficult it would be to be able to have a custom background or be able to draw on the datamodule canvas somehow so that the relationships of all the datasets can be nicely represented with arrows and stuff. Way back in Delphi 7 or so I seem to remember some sort of datamodule designer which has disappeared (I always found it annoying anyway). Does anyone know if this is possible through some sort of IDE plugin or something? 回答1: TDataModule is a direct descendant of TComponent,

What does TDataModule.ClassGroup pseudo-property in Delphi XE2 really do?

懵懂的女人 提交于 2019-12-07 07:55:13
问题 I tried to copy and paste a component from one data module into another in Delphi XE2. The component was a Fast Report data source link component. The data module was brand new, just created that second, in XE2. Someone else had the same problem and reported it on quality central as 106369 and same error message leading me to this mysterious DocWiki entry. So data modules now have a framework affinity, and a designtime-only pseudo property, which according to the docs: "Because the ClassGroup

What does TDataModule.ClassGroup pseudo-property in Delphi XE2 really do?

故事扮演 提交于 2019-12-05 13:21:29
I tried to copy and paste a component from one data module into another in Delphi XE2. The component was a Fast Report data source link component. The data module was brand new, just created that second, in XE2. Someone else had the same problem and reported it on quality central as 106369 and same error message leading me to this mysterious DocWiki entry. So data modules now have a framework affinity, and a designtime-only pseudo property, which according to the docs: "Because the ClassGroup pseudo-property is used only by the IDE and is not a compiler-generated property (hence, 'pseudo