Validate MySQL server

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Validate MySQL server

Post by oz8hp » Mon 18 Aug 2008 07:28

I am quite new to this MyDAC and Delphi (am an experience Access db developper) but now I have to write a program that cam convert data from >200 Paradox tables to a MySQL db and found that MyDAC is very good at this - maybe a bit slow in the insert, but that I will have to work on.

What I am looking for is a simple way to test the connection to the MySQL server when my program starts. I don't see any use in trying to insert records if the server is dead or the db is not found.

Any code snippets available out there.


(Please bear with me if this is not the correct place for asking - I just started using this forum)

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 20 Aug 2008 13:26

To connect to MySQL server you should use the TMyConnection component. Call TMyConnection.Connect method to establish a connection to the server. If server does not exists or is not running, the method raises an exception.

Post Reply