Arsip: Koneksi ZEOS dengan Password, Biasa gak ya?
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
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... :)
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 ....
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
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- Input Data Barang
by eni in Hal umum tentang Pascal Indonesia more 12 years ago - Request buat admin...
by p2bf in Kritik & Saran more 17 years ago - Delphi for PHP
by Kecret in OOT more 17 years ago - Bewara SQL for maniak
by ImanD in MySQL more 16 years ago - Math Parser di Delphi
by gus_pram in Enginering more 18 years ago - MySQL dan Oracle
by xproof in MySQL more 15 years ago - [ask]Text formating pada delphi
by accel.design in Bedah Kasus more 13 years ago - Tanya:bgmn cara komunikasi antar form ?
by stoopid in Network, Files, I/O & System more 17 years ago - formatdate
by ags606 in Hal umum tentang Pascal Indonesia more 17 years ago - Report berdasarkan ID nama pelanggan
by RoenZ in Reporting more 15 years ago