Hello Sergey Seroukhov and all,
I have got a problem when doing the Connection......
When i try to compile it, there is an error message said that Undeclared
identifier: 'MySqlLoadLib' and
Undeclared identifier: 'ZLibMySql.hdll'. Is there any other unit i need to
add in the uses caulses..??
I have add the Db, StdCtrls, ZTransact, ZMySqlTr, ZQuery, ZMySqlQuery,
ZConnect, ZMySqlCon...... ??
Any other i need to add or there is any other problem..??
>
> Ok.
>
> ======================= Start Cut =========================
> unit main;
>
> uses ... ZLibMySql...;
>
> type
> TForm1 = class (TForm)
> ....
> ZMySqlDatabase1: TZMySqlDatabase;
> ZMySqlTransact1: TZMySqlTransact;
> ...
> end;
>
> ...
>
> procedure PassConnect(DllHandle: Integer; Database: TZMySqlDatabase;
> Transact: TZMySqlTransact); library 'library.dll';
> procedure OpenForm; library 'library.dll';
> procedure CloseForm; library 'library.dll';
>
> procedure TForm1.Form1OnCreate(Sender: TObject);
> begin
> if not MySqlLoadLib then
> raise Exception.Create('Error loading libmysql.dll');
> PassConnect(ZLibMySql.hDll, ZMySqlDatabase1, ZMySqlTransact1);
> end;
>
> procedure TForm1.Button1OnClick(Sender: TObject);
> begin
> OpenForm;
> end;
>
> ...
> end.
>
>
> library library;
>
> interface
>
> ...
>
> procedure PassConnect(DllHandle: Integer; Database: TZMySqlDatabase;
> Transact: TZMySqlTransact);
> procedure OpenForm;
> procedure CloseForm;
>
> ...
>
> implementation
>
> procedure PassConnect(DllHandle: Integer; Database: TZMySqlDatabase;
> Transact: TZMySqlTransact);
> begin
> ZLibMySql.hDll := DllHandle;
> if not MySqlLoadLib then
> raise Exception('Error loading libmysql.dll');
> ZMySqlQuery1.Database := Database;
> ZMySqlQuery1.Transact := Transact;
> end;
>
> procedure OpenForm;
> begin
> ZMySqlQuery1.Open;
> Form2.Show;
> end;
>
> procedure CloseForm;
> begin
> Form2.Hide;
> ZMySqlQuery1.Close;
> end;
>
> ...
> end;
> ============================= End Cut =========================
>
> I did not compile this code, but I think the main idea should be clear
now.
>
> Bye, Sergey Seroukhov
> --------
> Capella Development Group, Donetsk, Ukraine
>
> To unsubscribe mail to
> [EMAIL PROTECTED] with 'unsubscribe' as the subject
> home page: http://www.zeos.dn.ua
To unsubscribe mail to
[EMAIL PROTECTED] with 'unsubscribe' as the subject
home page: http://www.zeos.dn.ua