is firstPeriodDate as TDateTime or String ? ----- Original Message ----- From: Allan, Samuel <[EMAIL PROTECTED]> To: Multiple recipients of list delphi <[EMAIL PROTECTED]> Sent: Thursday, January 23, 2003 10:32 AM Subject: [DUG]: Client Data Set error
> I am confused. I have some code to insert a record into a TClientDataSet. It looks like this: > > 1. CDSRegGroup.Insert; > 2. CDSRegGroup.FieldByName('reg_group').AsString := regGroup; > 3. CDSRegGroup.FieldByName('full_desc').AsString := fullDesc; > 4. CDSRegGroup.FieldByName('first_period_date').AsDateTime := firstPeriodDate; > 5. CDSRegGroup.Post; > > The client data set has three fields all listed above, and incidently showing their data types. They are all data fields. The client data set is the master in a master/detail relationship. > > There is also an index on reg_group which has the ixPrimary option set. Another index is on first_period_date, which is used to sort them. > > The string regGroup is: '2003ACYR'. > > On the first insert to a blank data set (possibly would get on all inserts) I get the following error on line 2: > > EVariantTypeCastError - Could not convert variant of type (string) into type (Date). > > No-one here knows what the heck causes this or how to fix it. I am stumped. Could someone please help me? > > -------------------------------------------------------------------------- - > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/