Solved

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

Posted on 2001-06-11
12
260 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
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 2

Expert Comment

by:danysz
Comment Utility
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:mnasman
Comment Utility
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
Comment Utility
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
 
LVL 2

Expert Comment

by:Felixin
Comment Utility
What is the database name in Table2?

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

Expert Comment

by:Felixin
Comment Utility
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:mnasman
Comment Utility
Hello

 use the full path for table name

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

and it works fine in formcreate

Mohammed
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 22

Expert Comment

by:mnasman
Comment Utility
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
Comment Utility
mnasman is OK
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
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
Comment Utility
Yes that's my e-mail: blagojj@makbanka.com.mk
Try my hotmail addres: bjgrandm@htomail.com
0
 
LVL 22

Accepted Solution

by:
mnasman earned 50 total points
Comment Utility
the first one gave me error
i sent you to the second one bjgrandm@hotmail.com
0
 

Author Comment

by:blash
Comment Utility
OK
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now