Hi All!
Sorry for the so simply question, but: how to retrieve data from my database with MyDAC ?
Please write some code
Sorry for bad English.
Retrieving data from database
Re: Retrieving data from database
In pretty much the same way as with any other sql-based dataset- you setup a connection and link a MyQuery component to it.RiF wrote: how to retrieve data from my database with MyDAC ?
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
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.