Not sure if this is a Delphi bug, but am having an issue with master /
detail ADO query pairs. (Result of conversion of a Delphi 3 MS SQL Server
app using the BDE to a Delphi 5 app using ADO)
While inserting of data in a new record in the master, the detail link shows
all fields as NULL until save of the master record, even though the record
count of the detail query is 1.

An example may help:

qryMaster = 'Select Ticket_Id, Officer_Id, [other details] from Ticket' -
has a datasource dsMaster to display fields on the form for editing.
qryDetail  = 'Select Officer_Id, Officer_Name from Officer where Officer_Id
= :Officer_Id' - this query is linked to qryMaster via the datasource
property. Officer_Name is linked to a read-only DBEdit field on the form for
display purposes.

When both queries are opened, the old application used to display the
Officer name whenever Officer_Id was changed in qryMaster, including when
the Master query was in dsInsert state.

Under ADO however, qryDetail still displays the Officer_Name whenever
Officer_Id (qryMaster) is changed EXCEPT when a new record is being added.
Any change to Officer_Id (qryMaster), returns a record in qryDetail
(qryDetail.RecordCount=1), but with Null values put into Officer_Id and
Officer_Name fields.

Is there any way around this, or am I resigned to looking at the problem in
a different manner?

TIA



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to