myQuery vs myTable

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Rober Watson
Posts: 7
Joined: Tue 02 Sep 2008 16:14

myQuery vs myTable

Post by Rober Watson » Wed 12 Nov 2008 17:34

I'm new to SQL, coming from a using XBase table background.

But I am writing an internet app now and have to use mySQL.

I have started off using myQuery components but recently decided that myTable might be more appropriate. As I understand it, if I make a query with myQuery, and then if anyone else adds a new record (including myself), if I want to see that record then I have to re-establish myQuery active:=false active:=true ... something like that.

Can myTable "see" a new record that someone else adds without doing anything "special"?? A general short advantage/disavantage of myQuery vs myTable would be helpful, if such a link is available.

Thanks in advance,
Bob

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Wed 12 Nov 2008 21:03

Hi Rober,
I'm new to SQL, coming from a using XBase table background.
Welcome to the Delphi world :) Hope you will enjoy it !
I have started off using myQuery components but recently decided that myTable might be more appropriate...A general short advantage/disavantage of myQuery vs myTable would be helpful
TmyTable basically list available tables in the database. When choosing a Table and opening it, TmyTable will simply perform a "Select * from YourTableName" query. You can get the same result with a TmyQuery component : just fill the SQL property with the correct SQL Statement.
Please note that TmyQuery is a more powerfull component : you can create sophisticated SQL statement to retreive datas from differents tables for example... I can't remember when I used a TmyTable component for the last time ;)
Can myTable "see" a new record that someone else adds without doing anything "special"??
Well, simply do :
- "mytable.refresh" for refreshing the whole table
- "mytable.refreshrecord" for refreshing ht e current record

Post Reply