Advertisement
endarfernandes

Modul Koneksi

Nov 26th, 2016
2,288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public conn As New ADODB.Connection
  2.  
  3. Function koneksi() As Boolean
  4.     Set conn = New ADODB.Connection
  5.     conn.Open "driver=mysql odbc 5.1 driver;server=localhost;user=root;database=kampus"
  6.     conn.CursorLocation = adUseClient
  7.     koneksi = True
  8. End Function
  9.  
  10. Sub main()
  11.     If koneksi = True Then
  12.         MsgBox "database terkoneksi"
  13.         Form1.Show
  14.     Else
  15.         MsgBox "database gagal"
  16.         End
  17.     End If
  18. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement