Discussion:
Save TDateTimePicker.date and DBEdit with ADOTable
(too old to reply)
Hansen
2003-12-30 09:39:53 UTC
Permalink
Hi, I need help.

I use ADOTable1 and DataSource1 on my Registration form.
The Table's fields inserted from DBEdit (ID, Name, Birthplace, Address) and
TDateTimePicker1 (Birthdate).
When I wanted to insert new data, I click on button "Insert", which had
these command lines :
ADOTable1.Insert;
DBEdit1.setfocus;

This works fine.
Then when I wanted to save the data, I click on button "Save", which had
these command lines:
try ADOTable1.post;
except
begin
beep; showmessage('Error occured while saving data');
ADOTable1.cancel;
end;
end;

If I use this kind of save, the DateTimePicker1.date won't be saved into the
table because it's not a DB component.

How could I save the DateTimePicker1.date into the field 'birthdate' in my
table?
Could still use the DBEdit? because with the DBEdit is easier for me to
manipulate data, except for the birthdate.
Any suggestion, please?
Kevin Frevert
2003-12-30 12:48:41 UTC
Permalink
Hansen,

Check out the BeforePost event on the TADOTable component or set the value
on the Save button click event.

Good luck,
krf
Post by Hansen
Hi, I need help.
Any suggestion, please?
Loading...