BANNER

Sabtu, 04 Juni 2011

ModuL Koneksi Database

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

Tidak ada komentar:

Posting Komentar