文章 "如何从 MQL5 (MQL4) 访问 MySQL 数据库" - 页 15

 
你好,我有一个问题(请原谅我是日语,因为这个句子不适合英文翻译)。这个程序支持多字节字符吗?
 
您好,我有一个问题。 (* 我是用翻译软件翻译的文本,因为我是日本人,所以我觉得这是奇怪的英语,但请原谅我)看了这里的文章,我正在编写 Mysql 的连接。 您可以用 SELECT 提取 1 字节字符,但多字节字符乱码。我更改了 Mysql 端和脚本端的字符编码设置,但还是不能乱码。原因是什么?

最好是这样。
 
Freemans Core:
是的,这是众所周知的问题,因为基本上使用的是 ASCII 编码。现在我正在开发 UTF 编码支持,以解决这个问题。
 
Eugeniy Lugovoy:
是的,这是众所周知的问题,因为基本上使用的是 ASCII 编码。现在我正在开发 UTF 编码支持,以解决这个问题。

感谢您的回复。同样,多字节不符合规范(ASCII)。我想再想想其他办法,谢谢。致以最诚挚的问候。
 

这对我来说效果很好......

有人能帮我通过调用存储过程插入数据吗?

正确的方法是什么?其他 SQLConnection 使用方法是这样定义参数 的:

command.Parameters.Add("@ID", SqlDbType.Int);
command.Parameters["@ID"].Value = customerID;

预先致谢。

汤姆

 
tommylux:

这对我来说效果很好......

有人能帮我通过调用存储过程插入数据吗?

正确的方法是什么?其他 SQLConnection 使用方法是这样定义参数的:

command.Parameters.Add("@ID", SqlDbType.Int);
command.Parameters["@ID"].Value = customerID;

预先致谢。

汤姆

只需使用以下命令即可:MySqlExecute(DB, "call YourProc("+(string)customerID+")")

不支持绑定变量

 
Eugeniy Lugovoy:
對於x64平台,使用下面的庫(附討論)
Your program link under Mysql in the operating system Windows Server 2008 64bit R2 SP1 , DB values are not stable, often is equal to -1, how to solve, please, Sir?  please tell me, Urgent need !  Paid services ,  contact me email:2393607300@qq.com (I use MQL4 EA )
 
Eugeniy Lugovoy:

Ok, I see you have wrote an expert advisor for this purposes, and it is written without recommendations I've posted in article.

So, let's move step by step:

1.  The calling of " DB = cMySqlConnect(Host, User, Password, Database, Port, Socket, ClientFlag); " should be made inside OnInit() standard function instead of OnTick().

2.  You are uses cMySqlConnect - it's imported function form DLL, you have to use MySqlConnect function instead of cMySqlConnect function !

3. You have to call MySqlDisconnect function inside OnDeinit() stundard function.

4. You have to check database connection identifier inside OnTick() standard function to be sure that connect was successful.

 

Finally it will looks like:

DB values are not stable, often is equal to -1

According to this method has been solved , thank you very much!

 
C_1982:
Your program link under Mysql in the operating system Windows Server 2008 64bit R2 SP1 , DB values are not stable, often is equal to -1, how to solve, please, Sir?  please tell me, Urgent need !  Paid services ,  contact me email:2393607300@qq.com (I use MQL4 EA )

MySQL database server disconnects automatically when no queries was sent during specified timeout (on server side), this is why you need to check connection with db and reconnect if needed.

 

It's very good!

Please support Chinese. Thanks.

E-MAIL: 547970398@qq.com