D
D
DankanPro2017-01-30 11:37:32
MySQL
DankanPro, 2017-01-30 11:37:32

FireDac how to set MySQL options before connecting to DB?

Before connecting, you need to set the MYSQL_INIT_COMMAND option
Tried like this:

TMySQLSession *session = (TMySQLSession *)FDConnection1->CliObj;
session->Lib->mysql_options_(session->MySQL, MYSQL_INIT_COMMAND, "call init_session()");
FDConnection1->Connected = true;

The problem is that the connection to the FireDAC database opens already from the first line, i.e. calling FDConnection1->CliObj automatically opens the connection.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question