Postingan

Menampilkan postingan dari November, 2009

Mencari Rekord Dengan InputBox

Tabel yang dipakai adl Tabel Supervisor Function CariSVisor() ' adl Fungsi Pencarian data On Error GoTo Handl Dim RsSVisorView As New ADODB.Recordset Dim MySQL, NOIS, UserMsg, TXt As String UserMsg = InputBox("Masukkan NIK Yang Dicari!", " Lab~Q 5", NOIS, 5000, 3500) If StrPtr(UserMsg) 0 Then ' Start of Usermessage NOIS = UserMsg MySQL = "SELECT From Tab_Karyawan " & _ "WHERE NIK LIKE '%" & UserMsg & "%' And Tab_Karyawan.Jabatan Not Like 'Teknisi' And Tab_Karyawan.Jabatan Not Like 'Petugas' ORDER BY Tab_Karyawan.Nama" RsSVisorView.Open MySQL, DbAcax, adOpenKeyset, adLockOptimistic If RsSVisorView.BOF = True And RsSVisorView.EOF = True Then ' cari NAMA Set RsSVisorView = Nothing MySQL = "SELECT * From Tab_Karyawan " & _ "WHERE Nama LIKE '%" & UserMsg & "%' And Tab_Karyawan.Jabatan Not Like 'Teknisi' And Tab_Karyawan.Jabatan Not Like ...

ADO Access Connection

Private Sub Form_Load() On Error GoTo handl Set DbAcax = New ADODB.Connection DbAcax.Open "Provider=MSDATASHAPE; Data Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=PassWord; Data Source=" & App.Path & "\.mdb" DbAcax.CursorLocation = adUseClient BukaRS Exit Sub handl: If Err 0 Then MsgBox Err.Description, , " Lab~Q 5" End If End Sub