documentation, pointers on TMyTable.Open in MyDAC

470 views Asked by At

I am learning Devart's mydac Data Access Components and I have few question I have not been able to resolve through online searches and the documentations. In the code examples, I see invocation of TMyTable.Open but I could not find the description in TMyTable class or its inheritance path. I would like to as if anyone can point me to the documentation of this method and whether it has any relationship to TDBGrid class.

Thanks in advance

2

There are 2 answers

0
Jens Mühlenhoff On BEST ANSWER

TDataSet.Open is generally used to get a data cursor back from the database.

In order to use a TDBGrid you need to connect it to the TDataSet (In your case a TMyTable) through a TDataSource.

On the other hand TMyTable.Execute will only run your SQL code on the server and not retrieve any data (except for some info on the affected rows).

You normally use Execute for INSERT, DELETE, UPDATE, etc and Open for SELECT statements.

0
jachguate On

In my case, a F1 keystroke while the caret is over a SQLQuery1.Open; brings the help in the DB.TDataSet.Open article, which in turn gave me a (broken) link to the current DocWiki Page. Far from perfect, but good enough to get basic information.

http://docwiki.embarcadero.com/VCL/en/DB.TDataSet.Open