UNKLAB FORUM

Forum Mahasiswa & Alumni Universitas Klabat
 
HomeSearchRegisterLog in

Share
 

 Cara mengkoneksikan VB.net ato VB6 ke MySQL

Go down 
AuthorMessage
CLiFF
Administrator
Administrator
CLiFF

Male Number of posts : 564
Age : 33
Location : Anywhere...
Points : 10009
Registration date : 2008-06-03

Cara mengkoneksikan VB.net ato VB6 ke MySQL Empty
PostSubject: Cara mengkoneksikan VB.net ato VB6 ke MySQL   Cara mengkoneksikan VB.net ato VB6 ke MySQL I_icon_minitimeThu Sep 18, 2008 9:47 pm

pertama....

sediakan dlu/download trus install MySQL ODBC driver

kalo gak punya silahkan download disini
Code:

http://dev.mysql.com/downloads/connector/odbc/3.51.html


nah contoh codingnya ini.....

Code:

Private Sub cmdConnectMySQL_Click()

Dim cnMySql As New rdoConnection
Dim rdoQry As New rdoQuery
Dim rdoRS As rdoResultset

' set up a remote data connection
' using the MySQL ODBC driver.
' change the connect string with your username,
' password, server name and the database you
' wish to connect to.

cnMySql.CursorDriver = rdUseOdbc
cnMySql.Connect = "uid=YourUserName;pwd=YourPassword;
server=YourServerName;" & _
"driver={MySQL ODBC 3.51 Driver};
database=YourDataBase;dsn=;"
cnMySql.EstablishConnection

' set up a remote data object query
' specifying the SQL statement to run.

With rdoQry
.Name = "selectUsers"
.SQL = "select * from user"
.RowsetSize = 1
Set .ActiveConnection = cnMySql
Set rdoRS = .OpenResultset(
rdOpenKeyset, rdConcurRowVer)
End With

' loop through the record set
' processing the records and fields.

Do Until rdoRS.EOF
With rdoRS

' your code to process the fields
' to access a field called username you would
' reference it like !username

rdoRS.MoveNext
End With
Loop

' close record set
' close connection to the database

rdoRS.Close
cnMySql.Close

End Sub

kalo ada kesalahan mohon koreksinya yah....

oh yah.. untuk connector lainnya juga bisa didownload disini
Code:

http://dev.mysql.com/downloads/connector/odbc/3.51.html

klo so nemau mo download.. datang ambe jo p qt.. coz so ada beberapa yg kita DL

thanx....

thanxto:copyninja

_________________
Einstein said "The true definition of stupidity is to do the same thing time and again and expect a different outcome."

Cara mengkoneksikan VB.net ato VB6 ke MySQL 130



http://unklab.forum.st/
Back to top Go down
http://unklab.forum.st
foreigner
Moderator
Moderator
foreigner

Male Number of posts : 74
Age : 38
Location : Abepura, Jayapura, ID
Points : 26
Registration date : 2008-06-07

Cara mengkoneksikan VB.net ato VB6 ke MySQL Empty
PostSubject: Re: Cara mengkoneksikan VB.net ato VB6 ke MySQL   Cara mengkoneksikan VB.net ato VB6 ke MySQL I_icon_minitimeSun Oct 05, 2008 10:03 am

contoh diatas menggunakan ODBC connection, ada contoh lainnya adalah menggunakan Mysql .NET Connection API yang bisa di download pada website mysql.com
download versi yg tidak perlu diisntal, agar lebih mudah penggunaanya, anda hanya menambah reference file dll tersebut pada project anda saat membuat aplikasi database menggunakan VB.NET, maka anda siap menggunakan class2 yang telah mereka buat
Back to top Go down
http://www.phpclasses.org
CLiFF
Administrator
Administrator
CLiFF

Male Number of posts : 564
Age : 33
Location : Anywhere...
Points : 10009
Registration date : 2008-06-03

Cara mengkoneksikan VB.net ato VB6 ke MySQL Empty
PostSubject: Re: Cara mengkoneksikan VB.net ato VB6 ke MySQL   Cara mengkoneksikan VB.net ato VB6 ke MySQL I_icon_minitimeWed Oct 08, 2008 7:10 pm

om foreigner... kalo boleh post step by step nya... biar yang bru mo blajar.. cepat mengertinya.... thanx yah...

_________________
Einstein said "The true definition of stupidity is to do the same thing time and again and expect a different outcome."

Cara mengkoneksikan VB.net ato VB6 ke MySQL 130



http://unklab.forum.st/
Back to top Go down
http://unklab.forum.st
foreigner
Moderator
Moderator
foreigner

Male Number of posts : 74
Age : 38
Location : Abepura, Jayapura, ID
Points : 26
Registration date : 2008-06-07

Cara mengkoneksikan VB.net ato VB6 ke MySQL Empty
PostSubject: Re: Cara mengkoneksikan VB.net ato VB6 ke MySQL   Cara mengkoneksikan VB.net ato VB6 ke MySQL I_icon_minitimeWed Oct 08, 2008 9:29 pm

cliff wrote:
om foreigner... kalo boleh post step by step nya... biar yang bru mo blajar.. cepat mengertinya.... thanx yah...

siipp... cuma blum dpt d p contoh yang agak simpel, sementara dicari, kalau ingin cari sendiri, kunjungi aja website www.planetsourcecode.com, or www.codeproject.com semua lengkap ada disitu.

semoga sukses
Back to top Go down
http://www.phpclasses.org
Sponsored content




Cara mengkoneksikan VB.net ato VB6 ke MySQL Empty
PostSubject: Re: Cara mengkoneksikan VB.net ato VB6 ke MySQL   Cara mengkoneksikan VB.net ato VB6 ke MySQL I_icon_minitime

Back to top Go down
 
Cara mengkoneksikan VB.net ato VB6 ke MySQL
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
UNKLAB FORUM :: KLABAT UNIVERSITY :: Computer Science Faculty :: Programming :: Visual Basic-
Jump to: