BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Save TDateTimePicker.date and DBEdit with ADOTable

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Hansen
Guest





PostPosted: Tue Dec 30, 2003 9:39 am    Post subject: Save TDateTimePicker.date and DBEdit with ADOTable Reply with quote



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?


Back to top
Kevin Frevert
Guest





PostPosted: Tue Dec 30, 2003 12:48 pm    Post subject: Re: Save TDateTimePicker.date and DBEdit with ADOTable Reply with quote



Hansen,

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

Good luck,
krf

"Hansen" <hansenbong (AT) imcindonesia (DOT) org> wrote

Quote:
Hi, I need help.
Any suggestion, please?



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.