Link to home
Start Free TrialLog in
Avatar of blash
blash

asked on

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

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
Avatar of danysz
danysz

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
Avatar of Mohammed Nasman
Hello

  U can use the date function to return the current date  

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

Mohammed
Avatar of blash

ASKER

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;
What is the database name in Table2?

Do you have a TDataBase component defined?.
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.
Hello

 use the full path for table name

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

and it works fine in formcreate

Mohammed
I test ur code with paradox table and it worked fine
if u still have problems send me ur program at nasman@mogaza.org
mnasman is OK
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
Avatar of blash

ASKER

Yes that's my e-mail: blagojj@makbanka.com.mk
Try my hotmail addres: bjgrandm@htomail.com
ASKER CERTIFIED SOLUTION
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of blash

ASKER

OK