Hi i started working on app with mysql and data module, on computer where i programing run perfect so copy the app and dll library , but when run on other computer first is tried to load the app from the folder where i programing or development the app , and i see data module when is create take all datas as was configured , so i move to not be first form on app to avoid that problem but still send me error can load library... now shoe me folder where the app is running is what i wanna....
two thinks...
1.- How i can change datas for datamodule when is the first to create on app.... to initialize all values
2.- How i can install the right dll because if is running 32 or 64 bits, as mentioned i put same dll i using on develop environment but on runing machine doesn't work..
procedure TDM.DataModuleCreate(Sender: TObject);
begin
INI := TINIFile.Create('Server.ini');
MySQLCTrav.ClientLibrary:='';
// if t4a_Is64BitWindows then begin
// MySQLCTrav.ClientLibrary:=GetCurrentDir+'\libmysql32.dll';
// end else begin
// MySQLCTrav.ClientLibrary:=GetCurrentDir+'\libmysql64.dll';
// end;
if( FileExists(GetCurrentDir+'\Server.ini')) then begin
MySQLCTrav.HostName := INI.ReadString('Server','HostIp','');
MySQLCTrav.UserName := INI.ReadString('Server','User','');
MySQLCTrav.Password := INI.ReadString('Server','Password','');
MySQLCTrav.DatabaseName := INI.ReadString('Server','DatabaseName','');
MySQLCTrav.Port := INI.ReadInteger('Server','Port',3306);
end else begin
MySQLCTrav.DatabaseName:='Traveler';
MySQLCTrav.HostName:='localhost';
MySQLCTrav.UserName:='kkkk';
MySQLCTrav.Password:='9999';
MySQLCTrav.Port:=3306;
Ini.WriteString('Server','HostIp',MySQLCTrav.HostName);
Ini.WriteString('Server','User',MySQLCTrav.UserName);
Ini.WriteString('Server','Databasename',MySQLCTrav.DatabaseName);
Ini.WriteString('Server','password',MySQLCTrav.Password);
Ini.WriteInteger('Server','Port',MySQLCTrav.Port);
end;
MySQLCTrav.ClientLibrary:=GetCurrentDir+'\libmysql.dll';
MySQLCTrav.Connected:=true;
end;