ZEOS is one component package to connect delphi with mysql database. to be able to interact with MySQL database ZEOS requires a library file that is libmysql.dll, the file can be obtained at the time we install heidisql. File position is located in C: \ Program Files \ HeidiSQL \libmysql.dll
we can download heidisql www.heidisql.com site.
ok.. next..
- create new application
- save all to c:\myproject\
- put libmysql.dll to c:\myproject\
- put tzconnection from zeos pallet to form
- add button
- change button1 caption : connect
- on button1 click write this code
procedure TForm1.Button1Click(Sender: TObject);
begin
// configuration pre connect
ZConnection1.Disconnect;
ZConnection1.HostName:='localhost';
ZConnection1.Protocol:='mysql';
ZConnection1.User:='root';
ZConnection1.Password:='';
ZConnection1.Port:=3306;
ZConnection1.LoginPrompt:=false;
// try connect to localhost
try
ZConnection1.Connect;
showmessage('connecting success..!')
except
showmessage('connecting fail..!')
end;
end;
source code unit
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes,
Graphics, Controls, Forms,
Dialogs, StdCtrls, ZConnection;
type
TForm1 = class(TForm)
ZConnection1: TZConnection;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
// configuration pre connect
ZConnection1.Disconnect;
ZConnection1.HostName:='localhost';
ZConnection1.Protocol:='mysql';
ZConnection1.User:='root';
ZConnection1.Password:='';
ZConnection1.Port:=3306;
ZConnection1.LoginPrompt:=false;
// try connect to localhost
try
ZConnection1.Connect;
showmessage('connecting success..!')
except
showmessage('connecting fail..!')
end;
end;
end.
form code
object Form1: TForm1 Left = 192 Top = 124 Width = 870 Height = 500 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object Button1: TButton Left = 208 Top = 96 Width = 75 Height = 25 Caption = 'Connect' TabOrder = 0 OnClick = Button1Click end object ZConnection1: TZConnection Left = 96 Top = 88 end end


I was looking at some of your content on this site and I believe this internet site is real informative! Keep on putting up.
Deci sanse mari ca JAVA sa fie dteacrotizama si chiar sa asistam la un boost da, au inceput cu darea afara a oamenilor din Sun
Title of the actirle should be 8 Of The Best Free Content Management Systems for the PHP/MySQL platform. An obvious CMS omission would be DotNetNuke on the .NET/MSSQL platform.