Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBEdits not following datasource

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I'm developing a Delphi 5 database application against a SQL server database back-end. I'm experiencing a hiccup with DBEdits and DBTexts placed on the form. I have a master/detail relationship set up between 2 queries. The detail result-set tracks successfully with the header (information in grid represents this) but the associated DBText/DBEdit components are not displaying the details - the components are blank until I attempt to scroll the grid of the details at which point they then display the correct details. Is this a common problem or am I missing something - I've tried forcing a refresh/repaint of the panel the DBEdit/DBText components are sitting on but this does nothing.
Can anyone help ?
Thanks in advance.
Steve
 
Are you using a TDBNavigator, and is it's Datasource set to the Master Query?
Is the params property of your Detail Query empty?
Is the datasource property of the Detail Query set to the Master Query?


S. van Els
SAvanEls@cq-link.sr
 
I also find that although the DBEdit components do not immediately show the data they are supposed to - if I click on them with the mouse - the data is suddenly shown. I'm guessing I'm looking at a refresh problem of sorts but have only just come accross it - some are fine others are not.
Any ideas ?
Steve
 
svanels : No - I'm not using a DBNavigator. The Params are set appropriately for the detail query (setting their data-types) and the datasource property is also set. The data is in the query result set fine - its just the DBEdits seem to be nudged in order for them to show the data as required .
 
The DBedits are from the Master Query or the Detail Query?
How do you Browse through the queries? S. van Els
SAvanEls@cq-link.sr
 
I think you have a synchronization problem.
Your Master query must supply a value for the detail query.

The detail table must have the following sql statements:

SELECT OrderNo, ItemNo, PartNo, Qty
FROM "items.db" Items
WHERE OrderNo = :OrderNo


The parameter :OrderNo must be supplied by the MasterQuery.

RightClick your Detail Query, bring up the fields editor, select the OrderNo field and set the following properties

1)LookUpDataSet: MasterQuery
2)LookUpKeyFields: OrderNo
3)LookUpResultField: OrderNo

The scrolling in your Database must be controlled by the MasterQuery if this is not parametrized Query


S. van Els
SAvanEls@cq-link.sr
 
svanels : The data in the query is fine - its the DBEdits that are causing the issue - there is no problem with the query. The grid shows the expected results
 
svanels : No on the network traffic score = running on a lone machine with SQL server installed locally. The master datasource is connected to a clientdataset - could that be a problem ?
Steve
 
Well I am using Delphi 4, and did not used this clientdataset component yet, but it is possible that this is causing problems.

In all my tables the datasource of the master query is empty. Else someother table of query will control the scrolling. S. van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top