Page 1 of 1

Connection Timezone Property

Posted: Wed 28 Aug 2013 17:29
by ConBran
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!

Re: Connection Timezone Property

Posted: Thu 29 Aug 2013 15:40
by DemetrionQ
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.

Re: Connection Timezone Property

Posted: Fri 30 Aug 2013 12:15
by ConBran
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!