SergioFeitoza Posted August 5, 2019 Share Posted August 5, 2019 Hi all. I need your help. I have a Unigui code in which a small MySql database was accessed by FireDac components. The code works and does 2 types of calculations. The first one “light and fast” and works well in Unigui. My initial problem was that the second calculation is heavier and when I try do it the code run but the result never comes (no error message at all). So I tried to replace the FireDac components used to access the MySql database by MyDAC components (Devart). They worked fine in my version for desktop usin Delphi. I changed my Unigui code just to replace the FireDac components (connection +query only) by the equivalent MyDac ones (worked well in desktop version without using Unigui) In this conversion the only component of MyDac which does not have an equivalent MyDac one is FDmanager. So I simply removed it. The fact is that when I run my Unigui code with the MyDac components I get no compilation error but when the code arrives to the lines below it give no errors but do not move from there with uniMainModule.connectionSFC do begin Close; // Add('DriverID=MySQL'); necessary in FireDac but not in MyDacao usar o MyDac Server:='127.0.0.1' ; Password:='XXXXXXXXXXXXXXXXXXXXX'; Port:=3306 ; Database:='MyDataBaseMySQLl' ; UserName:='root' ; Pooling:=True; PoolingOptions.MaxPoolSize:=15; loginPrompt:=False; Open; end; Very possibly is a very simple mistake I am doing. Can anyone help me with this?. If you need the relevant parts of the code to do the connection please write to sergiofeitozacosta@gmail.com and I will send you. By the way: I hope that using MyDac instead of FireDac my part of the “heavy code” will complete the calculations. Do you think that this is a good approach? Plus questions: --- Do you know any code using MyDac with Unigui? -- How to do an installer for a Unigui code including installation of MySql I I would pay for this) My private email is sergiofeitozacosta@gmail.com I thank you in advance Quote Link to comment Share on other sites More sharing options...
mierlp Posted August 6, 2019 Share Posted August 6, 2019 Hi First use the myConnection component. For testing click the right button and choose for CONNECTION EDITOR. Now set server, port, username, password, database and click DIRECT. I put the myConnection on the MainModule. Then you can use a datamodules with TQuery components and set tMyQuery.Connection to the TMyConnection component. In code it's about the same: myConnection.Server :=''you're ip address''|; myConnection.port= 3306; myConnection.Username := 'username'; myConnection.Password := 'password'; myConnection.Database :='databasename'; myConnection.Connect; 1 Quote Link to comment Share on other sites More sharing options...
SergioFeitoza Posted August 6, 2019 Author Share Posted August 6, 2019 Hi mierlp .Thank you for your reply. I think I am doing basically this. Tomorrow I will post my codes for MainModule and ServerModule. Probably I am missing some small detail related to MyDac With FireDac it works perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.