git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/tags/1.0.9@15 c93665c3-c93d-084d-9b98-7d5f4a9c3376
60 lines
1.5 KiB
ObjectPascal
60 lines
1.5 KiB
ObjectPascal
unit uTiendaWebUtils;
|
|
|
|
interface
|
|
|
|
function HayConexionConTienda(const AServer : String; const ABDName : String;
|
|
const ABDUser : String; const ABDPass : String; var ErrorMessage : String): Boolean;
|
|
|
|
|
|
implementation
|
|
|
|
uses
|
|
SysUtils, SqlExpr, Dialogs;
|
|
|
|
function HayConexionConTienda(const AServer : String; const ABDName : String;
|
|
const ABDUser : String; const ABDPass : String; var ErrorMessage : String): Boolean;
|
|
var
|
|
SQLConnection1: TSQLConnection;
|
|
begin
|
|
SQLConnection1 := TSQLConnection.Create(nil);
|
|
try
|
|
with SQLConnection1 do
|
|
begin
|
|
Name := 'SQLConnection1';
|
|
ConnectionName := 'MySQLConnection';
|
|
DriverName := 'MySQL';
|
|
GetDriverFunc := 'getSQLDriverMYSQL';
|
|
LibraryName := 'dbxmys30.dll';
|
|
LoginPrompt := False;
|
|
with Params do
|
|
begin
|
|
Clear;
|
|
Add('BlobSize=-1');
|
|
Add('DriverName=MySQL');
|
|
Add('ErrorResourceFile=');
|
|
Add('LocaleCode=0000');
|
|
Add('Compressed=True');
|
|
Add('Encrypted=True');
|
|
Add('Database=' + ABDName);
|
|
Add('HostName=' + AServer);
|
|
Add('User_Name=' + ABDUser);
|
|
Add('Password=' + ABDPass);
|
|
end;
|
|
VendorLib := 'LIBMYSQL.dll';
|
|
|
|
try
|
|
Connected := True;
|
|
Result := True;
|
|
Connected := False;
|
|
except
|
|
on E : Exception do
|
|
ShowMessage(e.Message);
|
|
end;
|
|
end;
|
|
finally
|
|
FreeAndNIL(SQLConnection1);
|
|
end;
|
|
end;
|
|
|
|
end.
|