There is a good function " FileAge ".
Question:
How to make it work for a file with a network path?
Because, on occasion, for example:

"DateTimeToStr (FileDateToDateTime (FileAge ('KOSTYA: D: \ Eng.gdb')))",

delphi throws an error:

"... class EConvertError with message 'Invalid argument to date encode' ..."

Such a variant of the path, the program takes from the property " DatabaseName " component " IBDataBase ". Thank.

  • What is it good, if declared as deprecated? Or is it wrong in your Delphi version? Then specify which version you are using. - kami
  • I am using Delphi7 version - Konstantin78
  • KOSTYA:D:\Eng.gdb is not a valid network path for standard file functions. - kot-da-vinci
  • So the fact is that you need to find out the last time of editing the database on the client? (when opening the application), i.e. path that uses FireBird - Konstantin78
  • one
    So you need to somehow convert this path to a valid one, which you can feed into the FileAge functions. - kot-da-vinci

1 answer 1

Your file path is incorrect. All network paths are indicated as follows:

 \\<хост>\<шара>\<файл> 

Kostya needs to go through the folder with the file, calling the ball db for example, then the path will work: \ kostya \ db \ Eng.gdb

  • " Man_Borsch " - I do not know how this option works for you? But I have the same error as before (it does NOT work) ("showmessage (DateTimeToStr (FileDateToDateTime (FileAge ('\ kostya \ db \ ENG.GDB'))));") - Konstantin78
  • @ Konstantin78, I'm sorry, I did not notice, the editor has saved the UNC path. Accessing a network resource does not begin with a single, but with a double slash. - Man_Borsch
  • Yes, really with two, it works. But the trick is that FireBird works from the database, according to its protocol (that is, via a closed network path, when the directory is not shared), and the FileAge function cannot do thisKonstantin78