Public conn As New ADODB.Connection
Public server As String
Public namadatabase As String
Public user As String
Public password As String
'Public Sub buka()
'If cn.State = adStateOpen Then cn.Close
'cn.Mode = adModeReadWrite
'cn.Open "Provider=SQLNCLI10;Server\SQLEXPRESS;Database;Trusted_COnnection=yes"
'End Sub
Sub koneksi()
server = ".\SQLEXPRESS"
Database = "libom"
user = ""
password = ""
If conn.State = adStateOpen Then conn.Close
conn.ConnectionString = "Provider=SQLNCLI10;Server=" & server & ";Database=" & Database & ";Trusted_COnnection=yes"
End Sub
Sub bukakoneksi()
Call koneksi
conn.Open
End Sub
Tidak ada komentar:
Posting Komentar