Page 1 of 1

MyDAC 3.55 -> 5.xx Units Changed - Need Compiler Directive

Posted: Thu 18 Jun 2009 16:30
by ShaiLeTroll
Hello,

Finally, my company provides the budget for the move to MySQL 5.1
But, we use an old version of MyDAC, 3.55, is not work with MySQL 5.1 (it worked for 4.1 and 5.0)
we work on many projects, and the migration from 3.55 to 5.00 requires changes (the TMyTable doesn't without SQL and there was abuse TMyTable with only TableName, I replace everything by TMyQuery)

the problem is that I must maintain a unique code for 3.55 and 5.00 because we can not migrate all the applications, I use MyAccess.MyDACVersion in RunTime, but I have problem in DesignTime, I have not found a compiler directive because TErrorAction has been moved from MyScript to DAScript

I want to do that

Code: Select all

uses
  ... {$IFDEF MYDAC_VER_500}DAScript, MyScript{$ENDIF}
      {$IFDEF MYDAC_VER_355}MyScript{$ENDIF} ...;
I am open to other ideas


PS : Sorry for my poor english

Re: MyDAC 3.55 -> 5.xx Units Changed - Need Compiler Directive

Posted: Thu 18 Jun 2009 16:59
by eduardosic
ShaiLeTroll wrote:Hello,

Finally, my company provides the budget for the move to MySQL 5.1
But, we use an old version of MyDAC, 3.55, is not work with MySQL 5.1 (it worked for 4.1 and 5.0)
we work on many projects, and the migration from 3.55 to 5.00 requires changes (the TMyTable doesn't without SQL and there was abuse TMyTable with only TableName, I replace everything by TMyQuery)

the problem is that I must maintain a unique code for 3.55 and 5.00 because we can not migrate all the applications, I use MyAccess.MyDACVersion in RunTime, but I have problem in DesignTime, I have not found a compiler directive because TErrorAction has been moved from MyScript to DAScript

I want to do that

Code: Select all

uses
  ... {$IFDEF MYDAC_VER_500}DAScript, MyScript{$ENDIF}
      {$IFDEF MYDAC_VER_355}MyScript{$ENDIF} ...;
I am open to other ideas


PS : Sorry for my poor english
TMyTable from MyDAC 3.55 and MyDAC 5.00 is total compatible.

you need upgrade MyDAC and open all forms from the project and make a Build All.

please, delete all files from a old version of MyDAC 3.55

go to work's fine.

Posted: Fri 19 Jun 2009 16:16
by ShaiLeTroll
I tested several times, I have changed in this day between 3.55, 4.30, 5.55 and 5.80 (trial) and Engine with MySQL 4.1 (EasyPHP 1.8), MySQL 5.0 (Wampserver 2.0c and mysql-essential), MySQL 5.1 ( Wampserver 2.0G-1 and mysql-essential, embedded) ... at a given moment, it did not work, surely my Delphi could do more (neither I)

I retested this afternoon, I use virtual machine, I uninstall 3.55, I check and delete files, dcu, bpl, ... I install 5.55, I Complete Build Internal Library DPK (herited object from TMy*...) and I Complete Buid Project Application it works (in fact, the another day, DataSetManager had crash before my problem)

We not use TMyTable on Forms, sometimes on DataModule, but the problem is with dynamically instantiated objects in the internal library of my company (no form, no owner) but I have not reproduced the bug (high probability of mixed file, I have not deleted each time the lib MyDac), then it is solved for this part

Otherwise, with more than 1000 forms in 10 projects, open them one by one is tedious but normally no developer has done that, the deposit is to use a Factory

And for the Compiler Directive and section "uses" problems,
you have an idea ?


.

Posted: Fri 19 Jun 2009 19:39
by swierzbicki
Hi,

Do you need some advices ? (as tu besoin d'aide ?).
I'm working a lot with dynamically created MyQueries and didn't face any issues so far.

Ps : glad to see that your firm has decided to update your MyDac components

Posted: Fri 19 Jun 2009 20:08
by eduardosic
ShaiLeTroll wrote:I tested several times, I have changed in this day between 3.55, 4.30, 5.55 and 5.80 (trial) and Engine with MySQL 4.1 (EasyPHP 1.8), MySQL 5.0 (Wampserver 2.0c and mysql-essential), MySQL 5.1 ( Wampserver 2.0G-1 and mysql-essential, embedded) ... at a given moment, it did not work, surely my Delphi could do more (neither I)

I retested this afternoon, I use virtual machine, I uninstall 3.55, I check and delete files, dcu, bpl, ... I install 5.55, I Complete Build Internal Library DPK (herited object from TMy*...) and I Complete Buid Project Application it works (in fact, the another day, DataSetManager had crash before my problem)

We not use TMyTable on Forms, sometimes on DataModule, but the problem is with dynamically instantiated objects in the internal library of my company (no form, no owner) but I have not reproduced the bug (high probability of mixed file, I have not deleted each time the lib MyDac), then it is solved for this part

Otherwise, with more than 1000 forms in 10 projects, open them one by one is tedious but normally no developer has done that, the deposit is to use a Factory

And for the Compiler Directive and section "uses" problems,
you have an idea ?


.
ShaiLeTroll, i create a small project in Delphi 7 with mydac 3.55... after this.. i open the project in Delphi 2007 with Mydac 5, last build.. i compile sucessful.. no problems with uses clause..

you can create a smal video ou project to show this problem?

thanks.

Posted: Mon 22 Jun 2009 09:35
by ShaiLeTroll
eduardosic wrote:you can create a smal video ou project to show this problem?
No, I can not reproduce this anomaly (it seems to me that it was only with MySQL 1.8 EasyPhp 4.1), I think that during my test day, I changed 5 times in a version (including 5.80 in trial) and I was confused (I maybe forgot a complete build)

Posted: Wed 09 Dec 2009 15:58
by ShaiLeTroll
Hello

I Found the reason of problèm with TMyTable,

Code: Select all

> # Set the SQL mode to strict
> sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
I change config file :

Code: Select all

> sql-mode=""
I don't have anymore errors !

the parameters sql-mode depends on the MySQL Kit Install :
WampServer = Empty
Essentials = "STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"


Other subjects :
I create my own directive EPC_MYDAC_VER_500_UP to keep a compatible code on internal library of my office with MyDac 3.55 et 5.55.
Also, I have solved the problem with DASript unit
I Change Project Options (I use VirtualBox) depending on the version of installed MyDac