Solved

I need to import computers system date in a *.dbf file trough a DBEdit

Posted on 2001-06-11
12
267 Views
Last Modified: 2010-04-06
Hi guys,

I want to import the local computers date,
first, I want to "see" it in a DBEdit object, and then
I want it to be entered in a *.dbf table field.

How do I do this?

Thanks,
Blash
0
Comment
Question by:blash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 2

Expert Comment

by:danysz
ID: 6176666
hi

u have to open a new record and when u open the form wiht new than write in the dbedit the date ( formatdatetime( ...))

when u will save it the date will be wroted in the file ..

daniel
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6176685
Hello

  U can use the date function to return the current date  

  Table1.Append;
  DBEdit2.Text := DateToStr(Date);
  Table1.Post;

Mohammed
0
 

Author Comment

by:blash
ID: 6176769
I get to see my sys date on the screen alright, but I can't see it in my database table. Maybe it's because I am
using the OnFormCreate event for this?

procedure TForm1.FormCreate(Sender: TObject);
begin
//DBEdit9.Text := FormatDateTime('dd.mm.yyyy',Now);
FMXUtils.CopyFile('c:\windows\desktop\zbnalgl0.dbf','c:\windows\desktop\temp\');
RenameFile('c:\windows\desktop\temp\zbnalgl0.dbf', 'c:\windows\desktop\zbnalgl.dbf');
Table2.TableName:= 'zbnalgl.dbf';
Table2.Active:=True;
//
Table2.Append;
DBEdit9.Text:=DateToStr(Date);
Table2.Post;
end;
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:Felixin
ID: 6176867
What is the database name in Table2?

Do you have a TDataBase component defined?.
0
 
LVL 2

Expert Comment

by:Felixin
ID: 6176891
Do you have a TDataSource defined?,

Does the data source point to Table2?

Does the DBEdit9 point to that TDataSource?

Does the DEBEdit9 field name point to the correponding field in the DBF table?

Sorry for the questions, but your code, except for the FMXUtils that I don't know what it is, looks fine.
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6176977
Hello

 use the full path for table name

Table2.TableName:= 'c:\windows\desktop\zbnalgl.dbf';

and it works fine in formcreate

Mohammed
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6176995
I test ur code with paradox table and it worked fine
if u still have problems send me ur program at nasman@mogaza.org
0
 
LVL 2

Expert Comment

by:Felixin
ID: 6176998
mnasman is OK
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6181245
Hello Blash

  I tried to send you email, but it gave me error is this ur email? : blagojj@makbanka.com.mk

  I sent you two emails, but they back to me, plz give me ur email

Mohammed
0
 

Author Comment

by:blash
ID: 6181330
Yes that's my e-mail: blagojj@makbanka.com.mk
Try my hotmail addres: bjgrandm@htomail.com
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 50 total points
ID: 6181387
the first one gave me error
i sent you to the second one bjgrandm@hotmail.com
0
 

Author Comment

by:blash
ID: 6181440
OK
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question