Module Module1
Public conn As MySqlConnection
Public cmd As MySqlCommand
Public dr As MySqlDataReader
Public da As MySqlDataAdapter
Public ds As DataSet
Public str As Строка < /p>
Код: Выделить всё
Public Sub koneksi()
Try
str = "Server=localhost;uid=root;pwd=1705;database=penjualan"
conn = New MySqlConnection(str)
If conn.State = ConnectionState.Closed Then
conn.Open()
MsgBox("Koneksi berhasil")
End If
Catch ex As Exception
'MsgBox("Koneksi gagal" + ex.Message)
End Try
End Sub
Module Module1
Public conn As MySqlConnection
Public cmd As MySqlCommand
Public dr As MySqlDataReader
Public da As MySqlDataAdapter
Public ds As DataSet
Public str As String
Код: Выделить всё
Public Sub koneksi()
Try
str = "Server=localhost;uid=root;pwd=1705;database=penjualan"
conn = New MySqlConnection(str)
If conn.State = ConnectionState.Closed Then
conn.Open()
MsgBox("Koneksi berhasil")
End If
Catch ex As Exception
'MsgBox("Koneksi gagal" + ex.Message)
End Try
End Sub
Подробнее здесь: https://stackoverflow.com/questions/795 ... le-module1
Мобильная версия