Mark
How are you linking the CDS to the Tquery object?
Martin
-----Original Message-----
From: Mark Derricutt [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 13:59
To: Multiple recipients of list database
Subject: [DUG-DB]: TField and FieldDefs... dynamicly
created persistent fields...
In my application I have the following code in a
TClientDataSet.OnBeforeOpen() handler:
with TIntegerField.Create(cdsJob) do
begin
FieldName := 'release_ref';
FieldKind := fkData;
Dataset := cdsJob;
Name := Dataset.name + FieldName;
cdsJob.fielddefs.add(Name,ftInteger,0,false);
cdsJob_copy.fielddefs.add(Name,ftInteger,0,false);
end;
I'm creating the TField, and also updating the FieldDefs
collection,
however, calling the CreateDataSet() returns with "cdsJob:
Field
'release_ref' not found.".
The above code is called within a conditional block that
checks for a
database that includes it, the TClientDataSet has persistent
fields already
setup in it, as does the TQuery its based on. Do I need to
add a
TField/FieldDef's reference to the underlying TQuery as well
as the
TClientDataSet?
Hmm, I just changed the code so that it added the
TField/FieldDef's to both
the query and the client data set but no joy :( (and yes -
the field DOES
exist in the database).
Mark
---------------------------------------------------------------------------
New Zealand Delphi Users group - Database List -
[EMAIL PROTECTED]
Website: http://www.delphi.org.nz
"WS SMTP relay" made the following
annotations on 01/15/01 13:54:41
----------------------------------------------------------------------------
--
[INFO] -- Content Manager:
[MMSSOV] Please note that the e-mail system is provided for
business purposes only.
============================================================================
==
"WS SMTP relay" made the following
annotations on 01/15/01 15:16:59
------------------------------------------------------------------------------
[INFO] -- Content Manager:
[MMSSOV] This e-mail message and any attachments are confidential to Sovereign Limited
and subsidiaries and subject to legal privilege. If you have received this e-mail in
error, please advise the sender immediately and destroy the message and any
attachments. If you are not the intended recipient you are notified that any use,
distribution, amendment, copying or any action taken or omitted to be taken in
reliance of this message or attachments is prohibited.
==============================================================================
---------------------------------------------------------------------------
New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz