ramiromd
ramiromd

Reputation: 2029

DBGrid not show records

Im try populate grid in Delphi, with values from database. For now, i have a TSQLConnection, TSQLQuery, TDataSource and TDBGrid.

The components are associated as follows:

1) myTDBGrid DataSource: myTDataSOurce
2) myTDataSource DataSet: myTSQLQuery
3) myTSQLQuery Connection: myTSQLConnection

When compile and run a error message broke the application:

Operation not allowed on a unidirectional dataset

Any ideas ?.

Upvotes: 2

Views: 4416

Answers (2)

ramiromd
ramiromd

Reputation: 2029

Thanks for all. Im using the next article: Building aVCL Forms dvExpress and works.

Upvotes: 1

Uwe Raabe
Uwe Raabe

Reputation: 47889

This is standard behaviour for dbExpress: all TSQLDataSets are unidirectional and a TDBGrid cannot handle those.

The solution is to use a TClientDataSet connected to a TDataSetProvider, which itself connects to TSQLQuery.

May I suggest reading the dbExpress tutorial?

Upvotes: 5

Related Questions