Tanya ???bagaimana caranya koneksi database mysql server dengn vibi

Go down

Tanya ???bagaimana caranya koneksi database mysql server dengn vibi

Post by rozi10 on Tue Sep 08, 2009 2:40 pm

bagaimana ce mas,klo koneksi database my sql server ke vibi......?????minta tolong ya ms,,,,,

rozi10
Lahir
Lahir

Jumlah posting : 1
Join date : 25.08.09

Lihat profil user

Kembali Ke Atas Go down

Re: Tanya ???bagaimana caranya koneksi database mysql server dengn vibi

Post by tubin on Wed Dec 30, 2009 10:22 am

install dulu MyODBC 3.51 sebagai connectornya bisa di download free kok
trus tambahkan references Microsoft Activex Data Object 2.5 Library

trus koneksinya begini

Private Sub buat_koneksi()
Dim Cn As String
Dim db_name As String
Dim db_server As String
Dim db_port As String
Dim db_user As String
Dim db_pass As String
'melihat error
On Error GoTo err_connection

db_name = "databaseku"
db_server = "localhost"
db_port = "3306" 'default port is 3306
db_user = "root"
db_pass = "password_anda"
'buat connection string
Cn = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_user & ";PWD=" & db_pass & ";PORT=" & db_port & ";OPTION=3"

'******************
'Buat koneksi
With Conn
.ConnectionString = Cn
.Open
End With

On Error GoTo 0
Exit Sub

err_connection:
MsgBox "Koneksi Error, coba periksa server!", vbcritical, "Error Connction"
End Sub

Semoga berhasilllll...

tubin
Lahir
Lahir

Jumlah posting : 2
Join date : 30.12.09

Lihat profil user

Kembali Ke Atas Go down

Kembali Ke Atas

- Similar topics

 
Permissions in this forum:
Anda tidak dapat menjawab topik