This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
LuisLeon_FactuGES/Servidor/Utiles/uTiendaWebUtils.pas
2007-06-11 17:36:55 +00:00

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.