Board index » delphi » Date transfer into database field

Date transfer into database field

Hi Group (and A Happy New Year to you all)

I've tried the free offer for a complete Delphi 4 found
on various magazines last month .. it seems
quite an interresting language .. but also works in
quite different ways being used to work with
Foxpro (dbase) ..

Can somebody tell me the correct way to do this ?

I have a field called "created" (made as date field) in a database - I want
to fill this field with the date the records is
added or updated. I have found the place where to put the routine but
need the correct syntax to take the system date and update the date field
(created)
in the database when the post button is pressed ..

Thank in advance

Svend

 

Re:Date transfer into database field


Sorry, I don't have the answer, but someone will probably post
it soon.  By the way, you may get more responses sooner if you
post to comp.lang.pascal.delphi.databases.

What I did want to warn you about is that there have been
recent discussion threads talking about how the Borland Database
Engine does not properly support Foxpro tables, and its use can
sometimes cause data corruption.  You may want to consider either
using standard dBASE tables, if you can, or purchasing a third-
party database engine.  You can read up on this topic by going to
the newsgroup archive at http://developers.href.com and typing in
the search engine "foxpro zzzDelphi" (without the quotes).  This
will give you all relevant postings in all Delphi newsgroups.
--
Rick Carter
carte...@email.uc.edu

Re:Date transfer into database field


Svend

The syntax is:

with MyTable do
begin
    Edit;
    // this assumes the field is a datetime field
    FieldByName('CREATED').AsDateTime := Date  ;
    Post;
end;

Hope that is what you are after.

Alan Jeffery
Professional Systems

Quote
"SES-Data" <nospam_ses-d...@wanadoo.dk> wrote in message

news:TjM36.80$152.47949939@news.mobilixnet.dk...
Quote
> Hi Group (and A Happy New Year to you all)

> I've tried the free offer for a complete Delphi 4 found
> on various magazines last month .. it seems
> quite an interresting language .. but also works in
> quite different ways being used to work with
> Foxpro (dbase) ..

> Can somebody tell me the correct way to do this ?

> I have a field called "created" (made as date field) in a database - I
want
> to fill this field with the date the records is
> added or updated. I have found the place where to put the routine but
> need the correct syntax to take the system date and update the date field
> (created)
> in the database when the post button is pressed ..

> Thank in advance

> Svend

Other Threads