Arsip: Koneksi ZEOS dengan Password, Biasa gak ya?

 
user image
more 16 years ago

Melon_Cry

Saya punya masalah, saya menggunakan Zeos untuk koneksi ke MySql. Cuma jika pakai password, koneksinya gagal. Bisa gak ya kalopake password. Sudah coba contoh login, gagal juga. Terima Kasih
user image
more 16 years ago

muktaf

kalo tidak saya sudah pernah di posting tentang ini coba search dulu yaa
user image
more 16 years ago

muktaf

atau begini saja sudah bikin user dimysql ? kalo belm bikin dulu user di mysql lalu test di zconnection isi user,pass,db,host sesuai dengan mysql yang ada lalu test connect ... sedikit contoh bikin file fault.cfg di folder tempat application berada isinya ---- HOST=127.0.0.1 <---- masukkan ipnya USERNAME=test DATABASE=test1 PASSWORD=test PORT=3306 -----

procedure loading;
var df: tstringlist;
path,fhost,fuser,fpass,fdb,fip,fport:string;
yui:integer;
begin
path:=extractfiledir(application.exeName);
df:=tstringlist.Create;
try
df.LoadFromFile(path+'\fault.cfg');
except
halt;
end;
for yui:= 0 to df.Count - 1 do
begin
if pos('HOST=',uppercase(df[yui]))<>0 then
begin
Fhost:=df[yui];
delete(fhost,1,pos('=',fhost));
end;
if pos('USERNAME=',uppercase(df[yui]))<>0 then
begin
Fuser:=df[yui];
delete(fuser,1,pos('=',fuser));
end;
if pos('DATABASE=',uppercase(df[yui]))<>0 then
begin
Fdb:=df[yui];
delete(fdb,1,pos('=',fdb));
end;
if pos('PASSWORD=',uppercase(df[yui]))<>0 then
begin
Fpass:=df[yui];
delete(fpass,1,pos('=',fpass));
end;
if pos('PORT=',uppercase(df[yui]))<>0 then
begin
Fport:=df[yui];
delete(fport,1,pos('=',fport));
end;
end;
        with form1 do begin
        ZConnection1.HostName:=fhost;
        ZConnection1.User:=fuser;
        ZConnection1.Database:=fdb;
        ZConnection1.Password:=fpass;
        zconnection1.Port:=strtoint(fport);
        zconnection1.Connected:=true;
    end;
end;
lalu cara menggunakan taru di form1.create

procedure TForm1.FormCreate(Sender: TObject);
begin
    loading;
end;
selamat mencoba... :)
user image
more 16 years ago

muktaf

kalo password tidak mau ketauan bisa tadi tanem di zconnection1 liat option Password masukin aja di sana dan zconnection1.Password:=fpass; di hapus aja ....
user image
more 16 years ago

Melon_Cry

@ muktaf thx, tak coba dulu. Dulu pernah nyoba demo bawaan Zeos, cuma jika MySql Servernya di kasih pass error.
more ...
  • Pages:
  • 1
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com