RiF wrote:
how to retrieve data from my database with MyDAC ?
In pretty much the same way as with any other sql-based dataset- you setup a connection and link a MyQuery component to it.
To setup a connection you use a TMyConnection component. The relevant properties are:
- Server - the address where the MySql server resides
- User - the MySql user to connect to the server
- Password - the user's password
- Database - the default database used in the connection
To link a TMyQuery component to a TMyConnection component use its Connection property, although this is rarely necessary: When you drop a TMyQuery component into a form or data module, MyDAC automatically searches for available connections. If there is one, it connects the dropped MyQuery to it. If there is more than one, it asks you which one to use.
From this point on, you work as usual: specify the SQL statement in the MyQuery's SQL property, send out the query with its Open method, traverse the returned rows with its Next method using FieldByName to retrieve field values or bind MyQuery directly to whichever data aware controls you wish through a DataSource.