Link to home
Start Free TrialLog in
Avatar of abdate
abdateFlag for Taiwan, Province of China

asked on

How to set Query's property DataSource with null source?

I set Query's Property DataSource for linking to Master Table,
such as: Query1.DataSource:=DataSource1.
But in running time, sometimes I want Query1 working independing.
Therefore I have to release this Master/Detail relation.
I wrote Query1.DataSource:='', and got compiler error.
Anyone can tell me how to define Query's property DataSource for a null source?
Thanks!

ps:When I define Query1.DataSource:=DataSource2,which DataSource2 point to nothing table.
And it is working, but I know it is not good method.


Avatar of Imbeginner
Imbeginner

hi abdate,

you can define another datasource as say you
or
you can use this work (closing the  query1)

 with query1.close the last data in dbgrid is disappeared

but about null datasource in delphi help:

All datasets must be associated with a data source component if  their data is to be displayed and manipulated in data-aware  controls. Similarly, each data-aware control needs to be associated  with a data source component in order for the control to receive and  manipulate data.


best regards
m.reza


ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of abdate

ASKER

Yes!It works.
Thanks!!