Arsip: Get Tablename di Zeos ???
more 17 years ago
Manz
Master Delphi ... gimana caranya ngambil nama table hasil dari SQL di ZQuery. seperti ngambil fields, tapi ini mah ngambil nama table nya...
Kan, kalo ngambil field begieu :
ZQuery.FieldCount
...
ZQuery.Fields[i].FieldName
Nah, ada gak yach kalo ZQuery.TableCount trus ZQuery.Tables[i].TableName ????
more 17 years ago
DelphiExpert
:mrgreen:
procedure GetTableNames(Connection: TZConnection; List: TStrings);
var
Metadata: IZDatabaseMetadata;
ResultSet: IZResultSet;
Types: TStringDynArray;
TBName: string;
begin
List.Clear;
Metadata := Connection.DbcConnection.GetMetadata;
SetLength(Types, 2);
Types[0]:= 'TABLE';
Types[1]:= 'VIEW';
ResultSet := Metadata.GetTables('', '', '', Types);
try
while ResultSet.Next do
begin
TBName:= ResultSet.GetStringByName('TABLE_NAME');
if List.IndexOf(TBName) < 0 then
List.Add(TBName);
end;
finally
ResultSet.Close;
end;
end;
more 17 years ago
deLogic
Thats right brother.. :)
cara lainnya, tetap menggunakan metadata (walaupun intinya juga akan panggil statement Metadata.GetTables)...:
SourceTables : TZSQLMedataData
Set property MetadataType ke mdTables
jika ingin menampilkan tabel saja tanpa view, set property Filter menjadi '(TABLE_TYPE = ' + QuotedStr('TABLE') + ')'
tinggal aktifkan query dan iterasi sampai EOF.
more 17 years ago
Manz
:mrgreen: Tank-Q master Delphi ...
Tapi kalo langsung ada gak yach ???
ZQuery.TableCount
... ZQuery.Tables[i].TableName
:mrgreen:
more 17 years ago
deLogic
wakakaa....
Manz.. kalo dikau pengen bikin wrapper.. kalo pake Delphi 2005 keatas, dikau bisa manfaatkan ClassHelper.. jika versi dibawahnya, bikin aja Interposer Class. :D
more 17 years ago
deLogic
@Manz..
mending dikau baca ini deh, gak promosi lho.. :D
http://blog.bprasetio.or.id/2007/04/02/class-helper/ dan
http://blog.bprasetio.or.id/2007/04/04/overloading-default-array-properties/
more 17 years ago
ImanD
xixiixix sama daku juga blom pernah manfaatin Interposer Class n ClassHelper.
@manz_delphi: :mrgreen: Tank-Q master Delphi ... Tapi kalo langsung ada gak yach ???yg pasti yg seperti itu emang ga ada bawaan delphi-nya langsung. @deLogic u/ Interposer Class sama sajakah seperti itu prosesnya?:mrgreen:ZQuery.TableCount ... ZQuery.Tables[i].TableName
more 17 years ago
deLogic
@ImanD:
maksudnya interposer class sama dengan ClassHelper..? Secara tujuan sih sama, yaitu way to extend a class.. tapi secara arsitektur mungkin sedikit berbeda, saya belum tahu persis internal kompilasi ClassHelper, jadi begini:
Interposer Class: a way to extend a class using inheritance
ClassHelper: a way to extend a class without using inheritance
more ...
- Pages:
- 1
- 2
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 4 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
- make Dbase via EXCEL
by nurez in onLinux more 18 years ago - On Screen Display (OSD)?
by wahyudi_delphi in Multimedia & Graphic Enhancement more 17 years ago - Virus lokal baru nih
by alnas in Enginering more 17 years ago - pesan gagal koneksi lewat ado
by e_soep in Tip n Trik Pemrograman more 17 years ago - mata uang baru, kurs hari ini
by LuriDarmawan in OOT more 15 years ago - Database Ngilang
by Chep_Rytheone in Paradox more 18 years ago - Visible Button
by keph47 in Form Enhancement & Graphical Controls more 13 years ago - kiim file text ke database
by jajang in Hal umum tentang Pascal Indonesia more 15 years ago - Keyboard Character?Help
by Durman in Hal umum tentang Pascal Indonesia more 17 years ago - View Data Grid
by delphicode in Bedah Kasus more 15 years ago