Selamat Datang Di Blogger Gerry_ota Berbagi Ilmu
Tampilkan postingan dengan label DELPHI 7. Tampilkan semua postingan
Tampilkan postingan dengan label DELPHI 7. Tampilkan semua postingan

Sabtu, 25 Mei 2013

Cara membuat Form Password di Borland Delphi 7

Cara membuat Form Password di Borland Delphi 7


Ass. Apa kabar kembali sobat Blogger he angel
Disini saya akan membahas bagaimana sih membuat sebuah form password di Borland Delphi 7.
Tanpa basa-basi sob langsung saja kita praktekan ya biar g,k jenuh dech heheherolling on the floor
Seprti biasa dibawah ini adalah desain form nya.thinking
Catatan: klik edit2 pada form yang telah di desain klick edit2  untuk mengganti karaketer password menjadi symbol bintang. Untuk lebih jelas nya lihat gamabar dibawah ini.devil



Selanjutnya buat loh form baru dengan cara pilih file-new-form pada menu Delphi. Maka akan tampil seperti gambar di bawah ini.
nah setelah membuat form baru langsung kita atur properties controlnya yang ada di bawah ini.
Aturlah properties controlnya.
Nama Control
Properties
Nilai Pengaturan
Form
Caption
Form Password
Label1
Caption
Nama User
Label2
Caption
Password
Button1
Caption
&OK
Buton2
Caption
&Close
Form
Caption
Selamat Datang di Form2
Label1
Caption
Anda Berhasil Login
 Selanjutnya ketikan listing program berikut ini:

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if edit2.text='nama pasword' then
begin
form2.show;
form1.Hide;
end
else
begin
  messagedlg('maaf password anda salah!!!!',mtinformation,[mbok],0);
edit1.Clear;
edit1.setfocus;
end;
end;
end.


jangan lupa save ya sob dengan nama unit dan project yang bebas …..asal tidak boleh pake spasi saja saat menyimpan nama file nya. Contoh U_Latihan1. P_Latihan1. rock on!
Nah sob,,,,,langsung saja sobat jalan kan programnya dengan cara menekan tombol F9 pada keyboard.
Kalau sukses maka tampilannya akan seperti gambar di bawah ini.
kalau password anda salah makan akan muncul pesan seperti gamabar di bawah ini
kalau password nya benar maka   akan langsung ke form 2 seperti gambar di bawah ini.
Horeeeeeeee,,,,,,,,,,,,,,pasword nya sudah jalan.....gimana sob cukup mudahkan......semoga artikel ini dapat bermafaat ya sob.....selamat mencoba.....Good lockkkkkkkkkk!!!!!!!!!!!!
:1                                                                                                             

Kamis, 23 Mei 2013

10 KONEKSI DATABASE PEMROGRAMAN DELPHI





Teknik Pemrograman Boralnd Delphi -- yang akan kita pelajari dalam pengolahan koneksi database dengan beberapa cara - tipe jenis koneksi -- sesuai dengan kebutuhan yang diperlukan oleh seorang programmer adalah database management system (RDBMS) dan disini kita akan membahas 10 - jenis koneksi database program aplikasi delphi dengan database (RDBMS) - Relatioanal Database Management System.
10-Koneksi Database Pemrogaman Delphi

- Koneksi Delphi Access Dengan ADO
- Koneksi Delphi Access Dengan ODBC
- Koneksi Delphi MSSQL Server dengan ADO
- Koneksi Delphi MSSQL Server dengan BDE
- Koneksi Delphi MSSQL Server dengan MSADODAC
- Koneksi Delphi MSSQL Server dengan ODBC
- Koneksi Delphi MYSQL dengan MyDac
- Koneksi Delphi MySQL dengan MySQLDAC
- Koneksi Delphi MySQL dengan ODBC
- Koneksi Delphi MYSQL dengan Zeos


dan anda bisa download contoh-contoh program aplikasi nya di sini : --->


-- -- -- Borland Delphi -- -- -- http://ri-htc.blogspot.com -- -- ---

Link -- Download Source Code Program Aplikasi Borland Delphi :

Download Source Code Program :

- Download Source Code - Koneksi Delphi Access Dengan ADO
- Download Source Code - Koneksi Delphi Access Dengan ODBC
- Download Source Code - Koneksi Delphi MSSQL Server dengan ADO
- Download Source Code - Koneksi Delphi MSSQL Server dengan BDE
- Download Source Code - Koneksi Delphi MSSQL Server dengan MSADODAC
- Download Source Code - Koneksi Delphi MSSQL Server dengan ODBC
- Download Source Code - Koneksi Delphi MYSQL dengan MyDac
- Download Source Code - Koneksi Delphi MySQL dengan MySQLDAC
- Download Source Code - Koneksi Delphi MySQL dengan ODBC
- Download Source Code - Koneksi Delphi MYSQL dengan Zeos
-- -- --

Download Tools Software Pendukung - Aplikasi Contoh Program :

-- -- --

--- Download Tools pendukung software
- Download tools softawre pendukung - postgresql-83
- Download tools setup
- Download tools upgrade
 -
http://www.ziddu.com/download/16107486/postgresql-8.3.rar.html
http://www.ziddu.com/download/16107495/SETUP.rar.html
http://www.ziddu.com/download/16107503/UPGRADE.rar.html

Rabu, 22 Mei 2013

KONEKSI FORM KE DATABASE DALAM DELPHI


Dalam sebuah aplikasi yang membutuhkan database untuk mengkoneksikannya terdapat langkah-langkah sebagai berikut : 
  1. Buat sebuah database menggunakan Ms.Acces 2003 dan save dengan nama sesuai keinginan. 
  2. Buka Borland Delphi 7
  3. Buat form baru, letakkan komponen ADOConnection, ADOTable, DataSource, DBNavigator dan  DBGrid.
  4. Pada ADOConnection: Double klik control ADOConnection1, muncul dialog connectionString. Klik tombol build…, muncul dialog data link properties. Jika kita ingin terhubung ke database access, pilih Microsoft Jet 4.0 OLE DB Provider. Klik Next. Pada tab connection, klik … pilih database yang akan digunakan. Klik test connection. Pastikan kita mendapat pesan Succeded. Klik OK. Kemudian klik OK. Ubah nilai property LoginPrompt menjadi false. Cari property connected dan ubah menjadi true. 
  5. Klik control ADOTable1. Ubah nilai property connection menjadi ADOConnection1. Ubah property tableName dan pilih table yang akan diakses. Ubah property active menjadi true. Klik control datasource. Beri nilai ADOTable pada property dataset. 
  6. Klik control DBGrid1 dan pilih datasorce1 pada property datasource.
  7. Lakukan hal yang sama pada DBNavigator. Jadi, data pada table akan ditampilkan
  8. Jalankan program.

MENGAKSES DATABASE MICROSOFT ACCESS DG DELPI 7


Mengakses database Microsoft Access
dengan Delphi 7.0

Seluruh dokumen di IlmuKomputer.Com dapat digunakan, dimodifikasi dan
disebarkan secara bebas untuk tujuan bukan komersial (nonprofit), dengan syarat
tidak menghapus atau merubah atribut penulis dan pernyataan copyright yang
disertakan dalam setiap dokumen. Tidak diperbolehkan melakukan penulisan ulang,
kecuali mendapatkan ijin terlebih dahulu dari IlmuKomputer.Com.
Dalam tulisan ini akan dijelaskan secara ringkas mengenai cara pengaksesan database yang dibuat
dengan Microsoft Acces yang kemudian data tersebut diolah/dimodifikasi dengan menggunakan
program Borland Delphi 7.0. Program yang dibuat terbatas pada menampilkan membuat database,
pembuatan program database, membaca database, menghapus database.
Pendahuluan
Database adalah sekumpulan data yang disusun sedemikian rupa sehingga mampu menghasilkan
sebuah informasi yang informatif bagi penggunanya.
Proses Pembuatan Program
Buat database dengan Ms Access dengan nama “Proyek Akhir.mdb”
1.  Buka Ms Acces
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
2
2.  File Ænew Æblank database
3.  Buat table baru
Dengan field-field sebagai berikut:
No Nama Filed  Data type  Properties  Value
1  Nama
Mahasiswa
Text  Field Size  25
2 NIM  Text  Field Size  12
3 Jurusan Text Field Size 20
4 Kelas  Text  Field Size  2
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
3
5  Nama
Pembimbing
Proyek Akhir
Text  Field Size  25
6  Text    Text Field Size  20
7  Judul Proyek
Akhir
Text Field Size  50
D 4.  iperoleh hasil akhir sebuah table dengan nama”Proyek Akhir.mdb” dengan
tampilan sebagai berikut :
Buat program interface (antarmuka) database Ms Access dengan Delphi 7.0.
1.  Buka Delphi 7.0
2.  Masukkan komponen sebagai berikut:
No Komponen Properti  Nilai
1  ADOConnection1
Dari component palete
”ADO”
Connection
String
Lihat Pada Catatan
di bawah.*
Connected  True
Login Prompt  False
2  ADOTable1
Dari component palete
”ADO”
Connection  ADOConnection1
Table Name  Proyek Akhir
Active  True
3  DataSource1
Dari component palete
”Data Access”
Data Set  ADOTable1
4
Dari component palete
ess”
Data Source  DataSource1  DBGrid1
”Data Acc
5  Data Source  DataSource1  DBNavigator
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
4
mponent  Dari co
palete”Data Access”
6  Button1
Dari component
palete”Standard”
Name  Button1
Caption  Simpan
7  Button2
Dari  component
palete”Standard”
Name Button2
Caption  Batal
8
andard”
Name Button3  Button3
Dari component
palete”St
Caption  Laporan
9
andard”
Caption  Nama Mahasiswa :  Label1
Dari component
palete”St
10
onent
palete”Standard”
IM :  Label2
Dari comp
Caption N
11  Label3
Dari component
palete”Standard”
Caption  Jurusan :
12
Dari component
tandard”
Caption  Kelas :  Label4
palete”S
13
onent
palete”Standard”
Nama Pembimbing
Proyek Akhir :
Label5
Dari comp
Caption
14  Label6
Dari component
palete”Standard”
Caption  Tanggal  SK
Pembimbing :
15
component
palete”Standard”
Caption  Judul Proyk Akhir :  Label7
Dari
16
onent
tandard”
-  Edit1
Dari comp
Text
palete”S
17  Edit2
Dari component
Text  -
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
5
palete”Standard”
18
component
-  Edit3
Dari
palete”Standard”
Text
19
Dari component
tandard”
Text  -  Edit4
palete”S
20  -  Edit5
Dari component
palete”Standard”
Text
21  Edit6
Dari component
palete”Standard”
Text  -
22
component
tandard”
Text  -  Edit7
Dari
palete”S
*Cat
Property Connection Stringdibuat dengan cara sebagai berikut:
1.  Klik pada properti Connection string pada Object Inspector,
kotak dilaog sebagai berikut:
Gambar 12. Membangun koneksi database
2.  Klik tombol Build, akan muncul kotak dialog  Data Link
Microsoft Jet 4.0 OLE DB Provider, lalu klik
atan :
sehingga muncul
Properties, pilih
Next
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
6
Gambar13 . Memilih Driver Database
dialog sebagai berikut:
Gambar 14. Mem Database
Klik pada tombol di sebelah kanan, select or enter a databae name.
Kemudian pilih database  Proyek Akhir.mdbyang telah dibuat
sebelumnya. Selanjutnya, klik tombol Test Connection, jika telah terjadi
3.  Klik tombol Build, akan muncul kotak
ilih
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
7
koneksi antara program yang akan dibuat dengan Database Microsoft
Accessyang telah dibuat maka akan muncul kotak dialog sebagai berikut
:
Gambar 15. Koneksi Sukses
Tampilan akhir program yang akan dibuat adalah sebagai berikut:
Double Click pada Button dengan caption “Batal”
Masukkan Source code sebagai berikut:
edit1.Text:='';
edit
edit3.Text:='';
edit4.Text:='';
Double Click pada Button dengan caption “Simpan”
2.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
8
Ma
Adotable1.Open;
AdoT
ADOT
ADOT
ADOT
ADOT ext;
Nama Pembimbing Proyek Akhir').AsString:=edit5.Text;
ADOTable1.FieldByName('Tanggal SK Pembimbing').AsString:=edit6.Text;
ADOTable1.FieldByName('JudulProyek Akhir').AsString:=edit7.Text;
ADOTable1.Post;
Catatan kecil : pada perintah
ADOTable1.FieldByName('Nama Mahasiswa').AsString:=edit1.Text;
Nama Mahasiswa adalah nama field yang dibuat pada database “Proyek akhir.mdb”, Field-field
dapat dilihat pada table paling atas.
Selanjutnya
Carany
Ketika  masing-masing edit.text dengan tulisan tertentu. Maka data/tulisan
tersebut akan ot n ke field-field dalam database yang telah dibuat.
Sebagai contoh adalah sebagai berikut
sukkan Source code sebagai berikut:
able1.Append;
able1.FieldByName('Nama Mahasiswa').AsString:=edit1.Text;
able1.FieldByName('NIM').AsString:=edit2.Text;
able1.FieldByName('Jurusan').AsString:=edit3.Text;
able1.FieldByName('Kelas').AsString:=edit4.T
ADOTable1.FieldByName('
Run Program yang telah
a adalah click RunÆRun
dibuat,
Atau tekan F9 pada Key Board
Diperoleh hasil eksekusi program sebagai berikut:
kita mengetik
omatis tersimpa
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
9
Sekian dulu ya, semoga bermanfaat..
Penutup
Sekian tulisan saya yang berjudul “Membuat Dialog Killer dengan Delphi 7.0”. Silakan
baca tulisan saya di IlmuKomputer.com sebagai berikut:
1.  “Kirim dan terima SMS di Hand Phone Nokia dengan Mudah menggunakan
komponen Oxygen SMS pada Delphi7.0”
2.  “Mengakses database Access dengan Delphi 7.0”
3.  “Membuat report pada Delphi 7.0 menggunakan komponen Rave Report”
4.
ikut  Hasilnya adalah sebagai ber
“Mengakses port parallel PC dengan Delphi 7.0 menggunakan komponen Small
Port”
Komunitas eLearning IlmuKomputer.Com
Copyright © 2003-2007 IlmuKomputer.Com
10
5.  SMS pada Delphi 7.0”
6.  “Cara Instalasi komponen Small Port pada Delphi 7.0”
7.  “Cara Mempercantik tampilan Program yag dibuat dengan Visual Basic
menggunakan komponen VB Skinner Pro”
8.  “Mempercantik tampilan Program yag dibuat dengan Delphi 7.0 menggunakan
Komponen Suipack”
9.  “Membuat Web sederhana dengan Joomla”
Referensi
Kadir, Abdul. 2005. Pemrograman Databse dengan Delphi 7.0 Menggunakan Access ADO.
Yogyakarta : Andi.
Biografi Penulis
Taufik Adi S. Numpang lahir di Garut, Jawa Barat. Dibesarkan di Kulon Progo. Saat ini tinggal di
Bantul. sedang dala an Pendidikan Teknik Elektro Universitas Negeri
Yogyak ambil adalah Kendali Industri. Salah satu alumni angkatan
2006 SMA Negeri 2 Wates Kulon Progo, yang pernah memiliki prestasi cukup membanggakan bagi
sekolah saat itu. Kegiatan yang dilakukan saat ini adalah bermain-main dengan bahasa Pemrograman
Delphi (khususnya Akses Port Paralel PC, Database dan Reporting, Akses SMS pada HP) Pernah juga
sedikit belajar tentang Visual Basic, serta bahasa C. serta sedikit belajar pengembangan web
sederhana dengan Joomla (Open Source) Hobi menulis artikel singkat, membaca buku , serta olah
raga (Bela diri). Aktif di beberapa kegiatan Kampus serta kegiatan sosial sebagai sarana
pengembangan diri.
“Cara Instalasi komponen Oxygen
m proses menyelesaikan S1 Jurus
arta. Konsentrasi Study yang di

MEMBUAT MP3 DENGAN APLIKASI DELPI 7

Ini merupakan artikel pertama saya tentang pemrograman Delphi. Meski keluarnya tutorial ini agak telat beberapa hari dari jadwal sebelumnya. Mudah-mudahan dapat bermanfaat :)

ilustrasi : shiro player
Dalam tutorial kali ini, kita akan mencoba mebuat sebuah MP3 Player sederhana menggunakan Delphi. Disini saya menggunakan Delphi7 untuk tutorial kali ini.

Pengenalan dan Persiapan

Berbeda dengan VB yang biasanya kita menggunakan component WindowsMedia Player untuk membuat MP3 Player. Dalam Delphi sudah ada component untuk membuat Player. Yaitu component TMediaPlayer yang ada di Tab System. Berikut adalah contoh dari icon TMediaPlayer yang ada di tab system

icon TMediaPlayer pada tab System.
Dan dibawah ini  inilah gambar dari component TMediaPlayer apabila kita masukan kedalam form.

Ok, sekarang buat form baru dan masukan bahan-bahan makanan atau komponen dibawah ini.
  • 1 BitBtn dari tab Additional, Properties (name : btnOpenFolder, Glyph : gambar pilihan anda)
  • 1 StaticText dari tab Additional, Properties (name : txtFolder, Border Style : sbsSunken)
  • 1 ListBox dari tab Standard, Properties (name : mp3List, Hint : Click to play)
  • 1 Progressbar, Properties (name:Progress)
  • 1 Timer, Properties (nama : ProgresTimer)
  • 1 GroupBox yang berisi 6 TLabel dan 6 TEdit. Beri nama pada masing-masing TEdit sesusai gambar berikut, yaitu edTitle, edArtist, edAlbum, edYear, edGenre, dan edComment.
  • 1 TMediaPlayer dari tab System, Properties ( name: mp3player)
Lalu susun komponen diatas seperti gambar dibawah ini.
Setelah ganti semua kode pada Unit1.Pas dengan kode dibawah ini.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
{ Article: Membuat MP3 Player Sederhana dari Delphi
http://replace.web.id
referensi delphi.about.com }
 
 
unit Unit1;
interface
 
uses
 
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 
StdCtrls, Buttons, MPlayer, ComCtrls, ExtCtrls;
type
 
TForm1 = class(TForm)
  mp3player: TMediaPlayer;
  mp3List: TListBox;
  btnOpenFolder: TBitBtn;
  GroupBox1: TGroupBox;
  edTitle: TEdit;
  edArtist: TEdit;
  edAlbum: TEdit;
  edYear: TEdit;
  edGenre: TEdit;
  edComment: TEdit;
  Label1: TLabel;
  Label2: TLabel;
  Label3: TLabel;
  Label4: TLabel;
  Label5: TLabel;
  Label6: TLabel;
  txtFolder: TStaticText;
  Progress: TProgressBar;
  ProgresTimer: TTimer;
  procedure btnOpenFolderClick(Sender: TObject);
  procedure mp3ListClick(Sender: TObject);
  procedure FormCreate(Sender: TObject);
  procedure ProgresTimerTimer(Sender: TObject);
private
 
{ Private declarations }
 
 
public
 
{ Public declarations }
 
end;
 
var
Form1: TForm1;
 
type
  TID3Rec = packed record
  Tag     : array[0..2] of Char;
  Title,
  Artist,
  Comment,
  Album   : array[0..29] of Char;
  Year    : array[0..3] of Char;
  Genre   : Byte;
 
end;
 
 
const
MaxID3Genre=147;
ID3Genre: array[0..MaxID3Genre] of string = (
'Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge','Hip-Hop', 'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B','Rap', 'Reggae', 'Rock', 'Techno', 'Industrial', 'Alternative', 'Ska','Death Metal', 'Pranks', 'Soundtrack', 'Euro-Techno', 'Ambient','Trip-Hop', 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance', 'Classical','Instrumental', 'Acid', 'House', 'Game', 'Sound Clip', 'Gospel','Noise', 'AlternRock', 'Bass', 'Soul', 'Punk', 'Space', 'Meditative','Instrumental Pop', 'Instrumental Rock', 'Ethnic', 'Gothic','Darkwave', 'Techno-Industrial', 'Electronic', 'Pop-Folk','Eurodance', 'Dream', 'Southern Rock', 'Comedy', 'Cult', 'Gangsta','Top 40', 'Christian Rap', 'Pop/Funk', 'Jungle', 'Native American','Cabaret', 'New Wave', 'Psychadelic', 'Rave', 'Showtunes', 'Trailer','Lo-Fi', 'Tribal', 'Acid Punk', 'Acid Jazz', 'Polka', 'Retro','Musical', 'Rock & Roll', 'Hard Rock', 'Folk', 'Folk-Rock','National Folk', 'Swing', 'Fast Fusion', 'Bebob','Latin', 'Revival','Celtic', 'Bluegrass', 'Avantgarde', 'Gothic Rock', 'Progressive Rock','Psychedelic Rock', 'Symphonic Rock', 'Slow Rock', 'Big Band','Chorus', 'Easy Listening', 'Acoustic', 'Humour', 'Speech', 'Chanson','Opera', 'Chamber Music', 'Sonata', 'Symphony', 'Booty Bass', 'Primus','Porn Groove', 'Satire', 'Slow Jam', 'Club', 'Tango','Samba','Folklore', 'Ballad', 'Power Ballad', 'Rhythmic Soul', 'Freestyle','Duet', 'Punk Rock', 'Drum Solo', 'Acapella', 'Euro-House', 'Dance Hall','Goa', 'Drum & Bass', 'Club-House', 'Hardcore', 'Terror', 'Indie','BritPop', 'Negerpunk', 'Polsk Punk', 'Beat', 'Christian Gangsta Rap','Heavy Metal', 'Black Metal', 'Crossover', 'Contemporary Christian','Christian Rock', 'Merengue', 'Salsa', 'Trash Metal', 'Anime', 'Jpop','Synthpop'
 
 {and probably more to come}
 
 
 
);
 
 
implementation
 
uses ShellAPI, ShlObj;  // needed for the BrowseForFolder function
 
{$R *.DFM}
 
procedure FillID3TagInformation(mp3File:string; Title,Artist,Album,Year,Genre,Comment:TEdit);
 
var //fMP3: file of Byte;
 
ID3 : TID3Rec;
fmp3: TFileStream;
 
 
begin
  fmp3:=TFileStream.Create(mp3File, fmOpenRead);
try
  fmp3.position:=fmp3.size-128;
  fmp3.Read(ID3,SizeOf(ID3));
finally
  fmp3.free;
end;
 
{ or the non Stream approach - as in ChangeID3Tag procedure
 
try
  AssignFile(fMP3, mp3File);
  Reset(fMP3);
try
  Seek(fMP3, FileSize(fMP3) - 128);
  BlockRead(fMP3, ID3, SizeOf(ID3));
finally
end;
 
 
 
finally
  CloseFile(fMP3);
end;
 
}
 
if ID3.Tag <> 'TAG' then begin
Title.Text:='Wrong or no ID3 tag information';
Artist.Text:='Wrong or no ID3 tag information';
Album.Text:='Wrong or no ID3 tag information';
Year.Text:='Wrong or no ID3 tag information';
Genre.Text:='Wrong or no ID3 tag information';
Comment.Text:='Wrong or no ID3 tag information';
 
end else begin
Title.Text:=ID3.Title;
Artist.Text:=ID3.Artist;
Album.Text:=ID3.Album;
Year.Text:=ID3.Year;
if ID3.Genre in [0..MaxID3Genre] then
Genre.Text:=ID3Genre[ID3.Genre]
else
Genre.Text:=IntToStr(ID3.Genre);
Comment.Text:=ID3.Comment
end;
end;
procedure ChangeID3Tag(NewID3: TID3Rec; mp3FileName: string);
 
 
var
fMP3: file of Byte;
OldID3 : TID3Rec;
begin
 
try
AssignFile(fMP3, mp3FileName);
Reset(fMP3);
try
Seek(fMP3, FileSize(fMP3) - 128);
 
BlockRead(fMP3, OldID3, SizeOf(OldID3));
if OldID3.Tag = 'TAG' then
{ Replace old tag }
Seek(fMP3, FileSize(fMP3) - 128)
else
 
{ Append tag to file because it doesn't exist }
 
 
Seek(fMP3, FileSize(fMP3));
BlockWrite(fMP3, NewID3, SizeOf(NewID3));
finally
 
end;
finally
CloseFile(fMP3);
end;
 
end;
procedure FillMP3FileList(Folder: string; sl: TStrings);
var Rec : TSearchRec;
 
begin
sl.Clear;
if SysUtils.FindFirst(Folder + '*.mp3', faAnyFile, Rec) = 0 then
try
 
repeat
sl.Add(Rec.Name);
until SysUtils.FindNext(Rec) <> 0;
finally
SysUtils.FindClose(Rec);
end;
end;
 
function BrowseDialog(const Title: string; const Flag: integer): string;
 
var
  lpItemID : PItemIDList;
  BrowseInfo : TBrowseInfo;
  DisplayName : array[0..MAX_PATH] of char;
  TempPath : array[0..MAX_PATH] of char;
begin
Result:='';
FillChar(BrowseInfo, sizeof(TBrowseInfo), #0);
with BrowseInfo do begin
hwndOwner := Application.Handle;
pszDisplayName := @DisplayName;
lpszTitle := PChar(Title);
ulFlags := Flag;
end;
 
lpItemID := SHBrowseForFolder(BrowseInfo);
if lpItemId <> nil then begin
SHGetPathFromIDList(lpItemID, TempPath);
Result := IncludeTrailingBackslash(TempPath);
GlobalFreePtr(lpItemID);
end;
 
end;
 
procedure TForm1.btnOpenFolderClick(Sender: TObject);
 
var mp3Folder : string;
 
begin
 
mp3Folder := BrowseDialog('Choose a folder with mp3 files', BIF_RETURNONLYFSDIRS);
 
if mp3Folder = '' then Exit;
 
txtFolder.Caption := mp3Folder;
 
//fill the list box with mp3 files
 
FillMP3FileList(mp3Folder, mp3List.Items);
end;
 
procedure TForm1.mp3ListClick(Sender: TObject);
var mp3File:string;
 
begin
if mp3List.Items.Count=0 then exit;
mp3File := Concat(txtFolder.Caption, mp3List.Items.Strings[mp3List.ItemIndex]);
if not FileExists(mp3File) then begin
ShowMessage('MP3 file '+#13#10+ mp3File +#13#10+'does not exist!');
exit;
end;
 
FillID3TagInformation(mp3File, edTitle, edArtist, edAlbum, edYear, edGenre, edComment);
 
Progress.Max:=0;
mp3player.Close;
mp3player.FileName:=mp3File;
mp3player.Open;
 
Progress.Max := mp3player.Length;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
txtFolder.Caption := ExtractFilePath(Application.ExeName);
FillMP3FileList(txtFolder.Caption, mp3List.Items);
Progress.Max:=0;
end;
 
 
procedure TForm1.ProgresTimerTimer(Sender: TObject);
 
begin
if Progress.Max<>0 then
Progress.Position := mp3player.Position;
end;
 
end.
Wah banyak juga yah ternyata. Sampe blenger juga mata saya, hehehe. Sekian dulu tutorial kali ini semoga bermanfaat :)

Membuat Database dengan Delphi 7

Kali ini saya akan memposting tentang caara pembuatan database melalui aplikasi delphi.
Proses Pembuatan Program
Buat database dengan Ms Access dengan nama “bismillah.mdb”
Kenpa bismillah? Karena kita harus memuai segala hal yang baik-baik dengan membaca bismillah. J
Namun pada dasarnya database saya berisi tentang data skripsi mahasiswa.
 Langsung ke TKP ya…
1.       Buka Ms Access
2.       Pilih file -> new -> blank database
3.       Kemudian buat table baru dengan field-field berikut :
No
Nama Field
Data Type
Properties
Value
1.
Nama Mahasiswa
Text
Field Size
50
2.
NIM
Text
Field Size
8
3.
Jurusan
Text
Field Size
20
4.
Kelas
Text
Field Size
5
5.
Nama Pembimbing
Text
Field Size
25
6.
Judul Skripsi
Text
Field Size
50

4.      Diperoleh hasil akhir sebuah table dengan nama”bismillah.mdb” dengan tampilan sebagai berikut : 
Buat program interface (antarmuka) database Ms Access dengan Delphi 7.0. 1. Buka Delphi 7.0 kemudian masukkan komponen sebagai berikut:

No
Komponen
Properti
Nilai
1.
Label 1
Caption
Data Judul Skripsi Mahasiswa Teknik Informatika 2012
2.
GroupBox1
Caption
Input Data
3.
Label1
Caption
Nama Mahasiswa
4.
Label2
Caption
NIM
5.
Label 3
Caption
Jurusan
6.
Label4
Caption
Kelas
7.
Label5
Caption
Nama Pembimbing Skripsi
8.
Label6
Caption
Judul Skripsi
9.
Edit1
Text
-
10.
Edit2
Text
-
11
Edit3
Text
-
12.
Edit4
Text
-
13.
Edit5
Text
-
14.
Edit6
Text
-
15.
Button1
Caption
Simpan
16.
Button2
Caption
Batal
17.
ADOConnection1
Dari component palate “ADO”
Connection String
Lihat padacatatan bawah.*
Connected
True
Login Prompt
False
18.
ADOTable1
Dari component palate “ADO”
Connection
ADOConnection1
Table Name
Proyek Akhir
Active
True
19.
DataSource1
Dari component palate “Data Access”
Data Set
ADOTable1
20.
DBGrid1
Dari component palate “Data Access
Data Source
DataSource1
21.
DBNavigator
Dari component palate “Data Access”
Data Source
Data Source1

*Catatan :
            Property Connection String dibuat dengan cara sebagai berikut:
1.      Klik pada property Connection String pada Object Inspector, sehingga muncul kotak dialog sebagai berikut :


2.      Klik tombol Build, akan muncul kotak dialog Data Link Properties, pilih Microsoft Jet 4.0 OLE DB Provider, lalu klik Next

3.      Klik tombol Build, akan muncul kotak dialog sebagai berikut :


4.      Klik pada tombol yang ada titik-titik tiga di sebelah kanan, select or enter a database name. Kemudian pilih database bismillah.mdb yang telah dibuat sebelumnya. Selanjutnya, klik tombol Test Connection, jika terjadi koneksi antara program yang akan dibuat dengan Database Microsoft Access yang telah dibuat maka akan muncul kotak dialog sebagai berikut:
Tampilan akhir program yang dibuat adalah sebagai berikut ;


Double Click pada Button dengan caption “Batal”
Masukkan Source Code sebagai berikut :
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
end;
Double Click pada Button dengan caption “Simpan”
Masukkan Source Code sebagai berikut :
procedure TForm1.Button1Click(Sender: TObject);
begin
Adotable1.Open;
AdoTable1.Append;
ADOTable1.FieldByName('Nama Mahasiswa').AsString:=edit1.Text;
ADOTable1.FieldByName('NIM').AsString:=edit2.Text;
ADOTable1.FieldByName('Jurusan').AsString:=edit3.Text;
ADOTable1.FieldByName('Kelas').AsString:=edit4.Text;
ADOTable1.FieldByName('Nama Pembimbing Skripsi').AsString:=edit5.Text;
ADOTable1.FieldByName('Judul Skripsi').AsString:=edit6.Text;
ADOTable1.Post ;
end;
Selanjutanya Run program yang telah dibuat atau dengan klik F9 pada keyboard.
 
Nah, sudah tampil kan hasil nya?
Oke,, sekarang kita akan mulai lagi dengan membuat aplikasi untuk masuk ke form 2.
Pertama, pilih menu file-> new-> form
Kemudian tambahkan beberapa komponen seperti berikut :
1.      Label
2.      Edit
3.      Button
Sesuaikan dengan kebutuhan anda. Isikan beberapa biodata anda dengan menggunakan komponen-komponen tersebut.
Kemudian pada property komponen Button ganti dengan “Back”
Nah, kalo udah selesai sekaraang kita mulai coding biar dari form satu bisa masuk ke form2
Pertama, balik ke Form1. Kemudian tambahkan komponen Button dan pada properties Caption ganti dengan “Admin”. Hal ini dimakasudkan anda memosisikan diri anda sebagai admin.
Kemudian, klik button Admin dua kali kemudian masukkan kode berikut :
procedure TForm1.Button3Click(Sender: TObject);
begin
Form2.Show;;
end;

end.

Setelah selesai balik lagi ke Form2. Pada Button Back masukkan kode berikut :
procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.Show;;
end;

end.

Kemudian tinggal klik Run, dan akan muncul hasil nya.
Agar lebih menarik tambahkan foto anda untuk background Form2 dengan cara tambahkan komponen Image.
Selamat Mencoba J
Selamat Mencoba.

Program yang telah dibuat tadi bisa didownload disini

DAFTAR ISI

IKLAN