MT4 arrested when I change timeframe of my expert

 

Hello, I have to connect my EA to a remote database using library LibmySQL.dll and mql4-mysql.mqh, but, when i change timeframe on the chart with the EA, my MT4 platform stop working.  

Does anyone know how to solve it? or ever encountered this problem?