Page 1 of 1

Mysql set LibraryLocation to exact path

Posted: 18.08.2014, 21:11
by drama22
any idea how to set LibraryLocation path to exact path ?

example i just currently use it like that

Code: Select all

dbconnect.LibraryLocation := 'C:\Users\username\Desktop\project\mysql\libmysql.dll';
this will give an error if i use it on other computer because the username will be different any idea how to make it in the main application folder ?

Re: Mysql set LibraryLocation to exact path

Posted: 24.08.2014, 13:47
by EgonHugeist
It's never a good idea to use such folders.. Why don't you use a sub-folder of you application installation folder and generate the Location "on the fly"? Or use the system-paths.....

Re: Mysql set LibraryLocation to exact path

Posted: 25.08.2014, 09:15
by marsupilami
Hello drama22,

usually it should be enough to set library location to libmysql.dll if the library is located in your application folder. If you want to place it in a subfolder, you could do something like

Code: Select all

dbconnect.LibraryLocation := ExtractFilePath(ParamStr(0)) + 'mysql\libmysql.dll';
Maybe you should implemet a checkl with fileexists before setting that value.
Best regards,

Jan

Re: Mysql set LibraryLocation to exact path

Posted: 25.08.2014, 19:12
by drama22
marsupilami wrote:Hello drama22,

usually it should be enough to set library location to libmysql.dll if the library is located in your application folder. If you want to place it in a subfolder, you could do something like

Code: Select all

dbconnect.LibraryLocation := ExtractFilePath(ParamStr(0)) + 'mysql\libmysql.dll';
Maybe you should implemet a checkl with fileexists before setting that value.
Best regards,

Jan
Thanks thats solve my issues .