‘ Declattion
Imports System.Data.OleDb
‘code
Private Sub btnConnect_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnConnect.Click
Dim Conn As OleDbConnection
Dim connStr As String
connStr = String.Format(“Provider=MySqlProv;” & _
“Location={0};Data Source={1};” & _
“User={2}; Password={3}”, _
txtServer.Text, txtDatabase.Text, _
txtUser.Text, txtPassword.Text)
Try
Conn = New OleDbConnection(connStr)
Conn.Open()
MsgBo
“Connected with ” + Conn.DataSource & _
Chr(10) + “Provider ” + Conn.Provider, _
MsgBoxStyle.Information, “Connected”)
Me.Text = “Connected with ” + Conn.DataSource
Catch ex As Exception
MsgBo
“Error to connecting : ” + ex.Message)
Finally
Conn.Close()
Conn.Dispose()
End Try
End Sub
Popularity: 1% [?]


Trackback
by Provider Of Computer Data
09 Feb 2008 at 15:56
Keep Your Computer Data Backup Files In A Secure Location…
You just cannot predict when something is going to go wrong with your computer or one of the files you have stored there, and when it does happen, any information you have stored is going to be lost, usually forever. It is always recommended that compu…