Borland C++ 2006 dbexpress connection Problem?

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
madman
Posts: 1
Joined: Sun 25 Nov 2007 19:13

Borland C++ 2006 dbexpress connection Problem?

Post by madman » Sun 25 Nov 2007 19:18

Hallo,
i have install dbxmda400.exe and my problem is that if i want to connect to mysql server with the ip 192.168.1.200 that my application want to conect to localhost with ip 192.168.1.185.
Where is the problem?
How i can conect to a mysql server?
thx.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 26 Nov 2007 08:28

In the code below replace values of the Database, User_Name and Password parameters with settings of your MySQL, and execute this code in your application.

Code: Select all

  #include 
  ...
  TSQLConnection* SQLConnection1 = new TSQLConnection(Application);
  SQLConnection1->DriverName = "MySQL Direct by Core Lab";
  SQLConnection1->LibraryName = "dbexpmda30.dll";
  SQLConnection1->VendorLib = "1";
  SQLConnection1->GetDriverFunc = "getSQLDriverMySQLDirect";
  SQLConnection1->Params->Clear();
  SQLConnection1->Params->Add("DriverName=MySQL");
  SQLConnection1->Params->Add("HostName=192.168.1.200");

  SQLConnection1->Params->Add("Database=test");
  SQLConnection1->Params->Add("User_Name=root");
  SQLConnection1->Params->Add("Password=root");

  SQLConnection1->Open();
  ShowMessage(BoolToStr(SQLConnection1->Connected, True));

Post Reply