Lazarus

Programming => Databases => Topic started by: adamski on August 11, 2009, 01:18:20 am

Title: TDBF component and filepath
Post by: adamski 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]
Title: Re: TDBF component and filepath
Post by: davesimplewear 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.
Title: Re: TDBF component and filepath
Post by: tatamata 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...
Title: Re: TDBF component and filepath
Post by: adamski on September 16, 2009, 11:22:48 pm

Thanks for everyone's help!