SlideShare a Scribd company logo
|Efmi Maiyana, S.Kom., M.Kom | 
Modul DataBase Kasus : Pendapatan Objek Wisata Langkah yang dilakukan : 
A. Buat Database ex:pendapatan_wisata 
B. Design File/table ex: 
tobjek dengan field sebagai berikut : 
Transaksi dengan field : 
C. Design Formulir sesuai dengan tabel diatas : 
Design Formulir Objek Wisata
|Efmi Maiyana, S.Kom., M.Kom | 
Objek Properties Nilai Properties 
Edit1 
Name 
Ekode 
Edit2 
Name 
Enama 
Edit3 
Name 
EhrgA 
Edit4 
Name 
EhrgD 
Button1 
Name Caption 
Bsave &Save 
Button2 
Name Caption 
BEdit &Edit 
Button3 
Name Caption 
BHapus &Hapus 
Button4 
Name Caption 
Bexit E&xit 
ADOConnection 
Name ConnectionString LoginPrompt defaultDatabase 
ADOConnection1 Provider=MSDASQL.1;Persist Security Info=False;Data Source=dbwisata; False pendapatan_wisata 
AdoTable 
Name Connection TableName Active 
ADOTable1 ADOConnection1 Tobjek True 
DataSource 
Name Dataset Enabled 
DataSource1 ADOTable1 True 
DBGrid1 
Name DataSource 
DBGrid1 DataSource1 
CrystalReport 
Name 
crobjek 
Koding: procedure TForm1.BSaveClick(Sender: TObject); var sql:String; begin
|Efmi Maiyana, S.Kom., M.Kom | 
sql:=('insert into tobjek values('''+Ekode.Text+''','''+Enama.Text+''','''+Ehrga.Text+''','''+Ehrgd.Text+''')'); Adoconnection1.Execute(sql); adotable1.Requery; showmessage('Data Telah di Save'); end; Pada DBGrid procedure TForm1.DBGrid1CellClick(Column: TColumn); begin ekode.Text:=dbgrid1.Fields[0].AsString; enama.Text:=dbgrid1.Fields[1].AsString; ehrga.Text:=dbgrid1.Fields[2].AsString; ehrgd.Text:=dbgrid1.Fields[3].AsString; end; procedure TForm1.BhapusClick(Sender: TObject); var sql: String; begin if (MessageDlg('Yakin Data di Hapus ?',mtConfirmation,[mbYes,mbNo],0)=mryes) then begin sql := ('delete from tobjek where kode='''+Ekode.Text+''''); ADOConnection1.Execute(sql); ADOTable1.Requery(); end; end; procedure TForm1.EkodeKeyPress(Sender: TObject; var Key: Char); var rs : TADOQuery; sql : string; begin if (key=#13) then begin sql := 'select * from tobjek where kode='''+Ekode.Text+'''' ; rs:=TADOQuery.Create(Self); rs.Connection := ADOConnection1; rs.SQL.Clear; rs.SQL.Add(sql); rs.Open; //Jika data Ketemu/Sudah Ada if not rs.Eof then begin ShowMessage('Data Sudah Ada'); end else begin Enama.SetFocus; end; end; end;
|Efmi Maiyana, S.Kom., M.Kom | 
‘Untuk Cetak Laporan procedure TForm1.BcetakClick(Sender: TObject); begin crobjek.ReportFileName:=('D:Data Amik Bkt2DelphiLatmoduldblapobjekwisata.rpt'); crobjek.RetrieveDataFiles; crobjek.Action:=1; end;

More Related Content

Similar to Modul data base delphi efmi

Microsoft access VBA communication with RS232 Peripherals
Microsoft access VBA  communication with RS232 PeripheralsMicrosoft access VBA  communication with RS232 Peripherals
Microsoft access VBA communication with RS232 Peripherals
topomax
 

Similar to Modul data base delphi efmi (6)

Rapid Prototyping with PEAR
Rapid Prototyping with PEARRapid Prototyping with PEAR
Rapid Prototyping with PEAR
 
Pedoman Pembuatan Sebuah Aplikasi
Pedoman Pembuatan Sebuah AplikasiPedoman Pembuatan Sebuah Aplikasi
Pedoman Pembuatan Sebuah Aplikasi
 
Advanced app building with PowerApps expressions and rules
Advanced app building with PowerApps expressions and rulesAdvanced app building with PowerApps expressions and rules
Advanced app building with PowerApps expressions and rules
 
Microsoft access VBA communication with RS232 Peripherals
Microsoft access VBA  communication with RS232 PeripheralsMicrosoft access VBA  communication with RS232 Peripherals
Microsoft access VBA communication with RS232 Peripherals
 
XPages Workshop: Concepts And Exercises
XPages Workshop:   Concepts And ExercisesXPages Workshop:   Concepts And Exercises
XPages Workshop: Concepts And Exercises
 
XPages - The Ties That Bind
XPages - The Ties That BindXPages - The Ties That Bind
XPages - The Ties That Bind
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 

Modul data base delphi efmi

  • 1. |Efmi Maiyana, S.Kom., M.Kom | Modul DataBase Kasus : Pendapatan Objek Wisata Langkah yang dilakukan : A. Buat Database ex:pendapatan_wisata B. Design File/table ex: tobjek dengan field sebagai berikut : Transaksi dengan field : C. Design Formulir sesuai dengan tabel diatas : Design Formulir Objek Wisata
  • 2. |Efmi Maiyana, S.Kom., M.Kom | Objek Properties Nilai Properties Edit1 Name Ekode Edit2 Name Enama Edit3 Name EhrgA Edit4 Name EhrgD Button1 Name Caption Bsave &Save Button2 Name Caption BEdit &Edit Button3 Name Caption BHapus &Hapus Button4 Name Caption Bexit E&xit ADOConnection Name ConnectionString LoginPrompt defaultDatabase ADOConnection1 Provider=MSDASQL.1;Persist Security Info=False;Data Source=dbwisata; False pendapatan_wisata AdoTable Name Connection TableName Active ADOTable1 ADOConnection1 Tobjek True DataSource Name Dataset Enabled DataSource1 ADOTable1 True DBGrid1 Name DataSource DBGrid1 DataSource1 CrystalReport Name crobjek Koding: procedure TForm1.BSaveClick(Sender: TObject); var sql:String; begin
  • 3. |Efmi Maiyana, S.Kom., M.Kom | sql:=('insert into tobjek values('''+Ekode.Text+''','''+Enama.Text+''','''+Ehrga.Text+''','''+Ehrgd.Text+''')'); Adoconnection1.Execute(sql); adotable1.Requery; showmessage('Data Telah di Save'); end; Pada DBGrid procedure TForm1.DBGrid1CellClick(Column: TColumn); begin ekode.Text:=dbgrid1.Fields[0].AsString; enama.Text:=dbgrid1.Fields[1].AsString; ehrga.Text:=dbgrid1.Fields[2].AsString; ehrgd.Text:=dbgrid1.Fields[3].AsString; end; procedure TForm1.BhapusClick(Sender: TObject); var sql: String; begin if (MessageDlg('Yakin Data di Hapus ?',mtConfirmation,[mbYes,mbNo],0)=mryes) then begin sql := ('delete from tobjek where kode='''+Ekode.Text+''''); ADOConnection1.Execute(sql); ADOTable1.Requery(); end; end; procedure TForm1.EkodeKeyPress(Sender: TObject; var Key: Char); var rs : TADOQuery; sql : string; begin if (key=#13) then begin sql := 'select * from tobjek where kode='''+Ekode.Text+'''' ; rs:=TADOQuery.Create(Self); rs.Connection := ADOConnection1; rs.SQL.Clear; rs.SQL.Add(sql); rs.Open; //Jika data Ketemu/Sudah Ada if not rs.Eof then begin ShowMessage('Data Sudah Ada'); end else begin Enama.SetFocus; end; end; end;
  • 4. |Efmi Maiyana, S.Kom., M.Kom | ‘Untuk Cetak Laporan procedure TForm1.BcetakClick(Sender: TObject); begin crobjek.ReportFileName:=('D:Data Amik Bkt2DelphiLatmoduldblapobjekwisata.rpt'); crobjek.RetrieveDataFiles; crobjek.Action:=1; end;