Board index » delphi » Delphi 3 Help please from a CLEVER Person.

Delphi 3 Help please from a CLEVER Person.

I need to get the data of a .db file that I am opening in an application.
I am not using the standard file-open dialog since i have the filename
storred in an .ini file.

I see that there is a function called FileGetDate..but the function requires
a file Handle as a parameter. I do not have the file handle to pass to this
function.

Does anyone know of a method to either determine the file handle or
to get the file date in some other way.

Your help will be greatly appreciated

Regards
Steve

 

Re:Delphi 3 Help please from a CLEVER Person.


VPL Man heeft geschreven in bericht +ADw-6q9cbt+ACQ-841+ACQ-1+AEA-hermes.is.co.za+AD4-...
I need to get the data of a .db file that I am opening in an application.
I am not using the standard file-open dialog since i have the filename
storred in an .ini file.

I see that there is a function called FileGetDate..but the function
requires
a file Handle as a parameter. I do not have the file handle to pass to this
function.

From D3-Help...

Unit
SysUtils
Category
File management routines
FileAge returns the date-and-time stamp of the specified file.
---
function FileAge(const FileName: string): Integer+ADs-
---
Description
The return value can be converted to a TDateTime value using the
FileDateToDateTime function. The return value is -1 if the file does not
exist.

(btw, none of my business, but you're posting in HTML+ADs- some newsgroup
administrators don't like this. It's quite voluminous... )

Regards,
Dirk Claessens
+AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8-
dirk.claessens+AEA-village.+ACM-NOSPAM+ACM-uunet.be
dirk.claessens.dc+AEA-belgium.+ACM-NOSPAM+ACM-agfa.com
remove +ACM-NOSPAM+ACM-  from mailheader
+AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8-

Re:Delphi 3 Help please from a CLEVER Person.


err...
First of all a *.db file is a Paradox file.
You will need to use a TTable object, set the path and the table name.
As far as any function which requires a Handle,
all you have to do is reference your object with the .Handle property i.e.: MyObject.Handle.
A handle is nothing more than an address of the object.
    VPL Man wrote in message <6q9cbt$84...@hermes.is.co.za>...
    I need to get the data of a .db file that I am opening in an application.
    I am not using the standard file-open dialog since i have the filename
    storred in an .ini file.

    I see that there is a function called FileGetDate..but the function requires
    a file Handle as a parameter. I do not have the file handle to pass to this
    function.

    Does anyone know of a method to either determine the file handle or
    to get the file date in some other way.

    Your help will be greatly appreciated

    Regards
    Steve

Re:Delphi 3 Help please from a CLEVER Person.


Well it's easy. It looks difficult because you and Delphi having a little
missunderstand. I have maked the following procedure to take that Date of
file.

function GetFileDate(Filename: String): TDateTime+ADs-
var
    FileHandle, Temp: Integer+ADs-
begin
    +AHs-Get file handle by opening it+AH0-
    FileHandle :+AD0- FileOpen(Filename,0)+ADs-
    +AHs-Get date+AH0-
    Temp :+AD0- FileGetDate(FileHandle)+ADs-
    +AHs-But FileGetDate is giving the Date and time in a strange+AH0-
    +AHs-Integer value. So, to make it TDateTime...+AH0-
    GetFileDate :+AD0- FileDateToDateTime(Temp)+ADs-
end+ADs-

----------------------------------------------------------------------------
----
I hope this helps.

Other Threads