Rabu, 08 Juni 2011
Imports System.Data
Imports System.Data.Sql
Module koneksi
Public database As New OleDb.OleDbConnection
Public tampil2 As New OleDb.OleDbCommand
Public tampilkan As OleDb.OleDbDataReader
Public hasilcek As String
Public Sub bukakoneksi()
database.Close()
Try
database.ConnectionString = "provider=sqloledb.1;integrated security=SSPI;persist security info=false; initial catalog=cobasql;data source=."
database.Open()
MessageBox.Show("Koneksi kedatabase berhasil")
Catch ex As Exception
MessageBox.Show("koneksi gagal")
End
End Try
End Sub
End Module
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
If UsernameTextBox.Text = "sep" And PasswordTextBox.Text = "123" Then
MDIParent1.Show()
Hide()
Else
MsgBox(" Kode yang anda masukkan Salah")
End If
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
End
Me.Close()
End Sub
End Class
Langganan:
Postingan (Atom)