Recent

Author Topic: TDBF component and filepath  (Read 6851 times)

adamski

  • New Member
  • *
  • Posts: 16
TDBF component and filepath
« on: August 11, 2009, 01:18:20 am »

Hi - when using the TDBF component, I can set the FilePathFull to reference files. Works well.
However, what I really want is the ability to reference a relative directory - just a sub directory called "data"

I've tried various combinations, but cannot get the relative directory to work.
E.g. FilePath:= 'data/'

Also, I plan to run this application on both Linux and Windows, so I'll like to know how to reference relative directories for both platforms...

All the best, and thanks for any help !

[I'm using the latest 0.9.27 release]

davesimplewear

  • Sr. Member
  • ****
  • Posts: 307
    • Davids Freeware
Re: TDBF component and filepath
« Reply #1 on: August 15, 2009, 02:03:23 am »
Hi,

I usually use the ExtractFilePath(ParamStr(0)) + 'data' to accomplish this. The delimeter is not needed because this is already included in the function.
All things considered insanity seems the best option

tatamata

  • Hero Member
  • *****
  • Posts: 693
    • ZMSQL - SQL enhanced in-memory database
Re: TDBF component and filepath
« Reply #2 on: September 13, 2009, 02:34:32 pm »
I was using extractfiledir(application.exename) to get current directory where executable is.
ApplicationPath:=extractfiledir(application.exename);
RelativePath:='data';
FullPath:=ApplicationPath+LastDelimiter('/\',ApplicationPath)+RelativePath;

Something like that...

adamski

  • New Member
  • *
  • Posts: 16
Re: TDBF component and filepath
« Reply #3 on: September 16, 2009, 11:22:48 pm »

Thanks for everyone's help!