Hi,
Hopefully you can help me, maybe I am doing something wrong here!
I create a new Multi-Device Application, select Tabbed with Navigation in RAD Studio Tokyo 10.2.
I add an Edit box on the first page and then add a datamodule. On the datamodule I add a function that returns a string. On the first page I call the function in the datamodule and display the result string in the Edit box. So far so good.
I add a TMyConnection to the datamodule and simply set the parameters, Server, Username, Password and database. I do not try an connect or do anything else with this component, just set those 4 parameters.
I leave the result as a simple string and add a try except returning the E.Message as the string if it excepts.
It excepts every time with an Access violation. I can have the TMyConnection on the datamodule as long as I do nothing with it, as soon as I try to do anything with the TMyConnection I get the Access Violation.
Is this expected? Why?
Is there anything other information I can provide?
MyDAC components on a Datamodule in a Multi-Device Application
Re: MyDAC components on a Datamodule in a Multi-Device Application
Unfortunately, we cannot reproduce the issue.
In order to get a detailed answer, please compose a small sample demonstrating the issue and send it to usvia form e-support: https://www.devart.com/company/contactform.html
In order to get a detailed answer, please compose a small sample demonstrating the issue and send it to usvia form e-support: https://www.devart.com/company/contactform.html
Re: MyDAC components on a Datamodule in a Multi-Device Application
Hi Viktor,
I have sent you a test project showing the issue.
I have sent you a test project showing the issue.
Re: MyDAC components on a Datamodule in a Multi-Device Application
This error is not related to MyDAC functionality, but to your application architecture. The error occurs due to the fact that when calling your DataModule1.ThisIsADM function in the TTabbedwithNavigationForm.FormCreate method the TDataModule class is not created yet. You can make sure in it by executing the code line Self.Tag := 1 in your function. To solve the issue, you can add the line if Assigned(Self) then to your function.
Re: MyDAC components on a Datamodule in a Multi-Device Application
Thank you Viktor, this was exactly it.
Re: MyDAC components on a Datamodule in a Multi-Device Application
Thank you for the interest in our products.
Please contact us if you have any questions about our products.
Please contact us if you have any questions about our products.