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

Posted on 2003-03-08
Medium Priority
Last Modified: 2010-08-05
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?

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.

Question by:abdate
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8096833
hi abdate,

you can define another datasource as say you
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

LVL 27

Accepted Solution

kretzschmar earned 60 total points
ID: 8097121



meikl ;-)

Author Comment

ID: 8097381
Yes!It works.

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month9 days, 3 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question