Connection Timezone Property

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ConBran
Posts: 4
Joined: Wed 28 Aug 2013 17:20

Connection Timezone Property

Post by ConBran » Wed 28 Aug 2013 17:29

Hi All,

I have an application that is connecting to a MySQL database from various countries and have recently migrated from using ODBC to the MyDAC suite of components.

However, in doing so, I have noted that the MySQL connection's timezone property is no longer being set - ODBC does this automatically if a timezone is selected in the connections properties.

Is there a way to do this automatically through a property/option on the TMyConnection component? I have reviewed it, and searched forums etc, but can't find anything. I am having to implement a query execution in the AfterConnection method for the component - but, because I am creating and freeing some connection components on the fly, I am worried I may miss this extra step.

Any thoughts on this? Is it even possible? Or should I request an enhancement via the 'user voice' submission page?

Thanks for your time!

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Connection Timezone Property

Post by DemetrionQ » Thu 29 Aug 2013 15:40

Hello.

You can change the value of the MySQL timezone system variable ( http://dev.mysql.com/doc/refman/5.0/en/ ... _time_zone ) only using an appropriate SQL query, for example:

Code: Select all

MyConnection1.ExecSQL('SET time_zone = ''-8:00''');
If you want to have a separate option in the TMyConnection component for this MySQL system variable, you can buy a version with source code and implement such functionality by yourself (we will show you how to do it).

You can also suggest this feature at our UserVoice ( http://devart.uservoice.com/forums/1046 ... components ) . If the suggestion gets a lot of votes, we will consider the possibility to implement it.

ConBran
Posts: 4
Joined: Wed 28 Aug 2013 17:20

Re: Connection Timezone Property

Post by ConBran » Fri 30 Aug 2013 12:15

Hi DemetrionQ,

Yeah, that's what we are currently doing with the AfterConnection method, was just wondering if there was an easier way.

I'll put a request in through the User Voice section and will speak with the higher ups regarding purchasing a copy with the source code.

Thanks!

Post Reply