0% found this document useful (0 votes)
32 views4 pages

Universitas Al Muslim: DI S U S U N Oleh

This document is a program code written in Visual Basic that connects to an Access database called "gampong.mdb" located in the "D:\Data\data program\san\" folder. The code defines form controls and database objects, and contains procedures to insert, clear, and display data from a table called "Irsan" in the database. User input from text boxes is inserted into the table and a datagrid control displays the records.

Uploaded by

Irsan Razali
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views4 pages

Universitas Al Muslim: DI S U S U N Oleh

This document is a program code written in Visual Basic that connects to an Access database called "gampong.mdb" located in the "D:\Data\data program\san\" folder. The code defines form controls and database objects, and contains procedures to insert, clear, and display data from a table called "Irsan" in the database. User input from text boxes is inserted into the table and a datagrid control displays the records.

Uploaded by

Irsan Razali
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

DI S U S U N OLEH

NAMA NIM : IRSAN : 07110585

SMEST/UNIT : III/H DOSPEN : ASRIANDA.S.Kom

FAKULTAS TEKNIK INFORMATIKA

UNIVERSITAS AL MUSLIM
MATANGGLUMPANGDUA KAB. BIREUEN
2008/2009

Dim Db As ADODB.Connection Dim RS As ADODB.Recordset

Private Sub Cmdbatal_Click() Bersih End Sub Private Sub Cmdkeluar_Click() Unload Me End Sub Private Sub Cmdsimpan_Click() Db.Execute "insert into Irsan(kode,nama,jenis,banyak)values ('" & Txtkode.Text & "','" & Txtnama.Text & "','" & Txtjenis.Text & "','" & Txtbanyak.Text & "')" Bersih tampil End Sub Private Sub tampil() Dim RS As New ADODB.Recordset Dim SQL As String SQL = "SELECT * FROM Irsan WHERE 1=1" RS.CursorLocation = adUseClient RS.Open SQL, Db, adOpenStatic, adLockReadOnly With DataGrid1 Set .DataSource = RS .MarqueeStyle = dbgHighlightRowRaiseCell .Refresh End With End Sub

Private Sub Form_Load() Set Db = New ADODB.Connection Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Data\data program\san\gampong.mdb;Persist Security Info=False" Txtkode.MaxLength = 3 Txtnama.MaxLength = 50 Txtjenis.MaxLength = 50 End Sub Private Sub Bersih() Txtkode.Text = "" Txtnama.Text = "" Txtjenis.Text = "" Txtbanyak.Text = "" Txtkode.SetFocus End Sub Private Sub Txtbanyak_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{tab}" End If End Sub Private Sub Txtjenis_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{tab}" End If End Sub Private Sub Txtkode_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{tab}" End If End Sub Private Sub Txtnama_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{tab}" End If End Sub

You might also like