First You Must Download ODBC 5.2w at http://dev.mysql.com/downloads/connector/odbc/
Next Open Your ODBC
And click Add
Next click MYSQL ODBC 5.2w Driver
Click Finish And
Click OK and Click OK Again
Creating Your MYSQL
Create Database With Name data
Create Table with name user_data
CREATE TABLE user_data(
useridINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
name CHAR(20) NOT NULL,
username CHAR(20) NOT NULL,
pass CHAR(20) NOT NULL
);
Oke Next Open Your Visual Basic 6 Standart Exe
Create Form Like This
1 Command Button (cmdOK)
3 Label (Nama,Username,Password)
3 Text Box (name,username,pass)
And Double Click cmdOK
insert Script Like This
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub cmdOK_Click()
If Text1.Text = "" Then
MsgBox ("Masukan Nama Anda")
Else
If Text2.Text = "" Then
MsgBox ("Masukan Username")
Else
If Text3.Text = "" Then
MsgBox ("Masukan Password")
Else
conn.Execute "INSERT INTO user_data(name, username, pass,) VALUES('" & Name.Text & "','" & username.Text & "','" & pass.Text & "')", , adExecuteNoRecords
End If
End If
End If
MsgBox (" Register Anda Berhasil ")
End Sub
Private Sub Form_Load()
Set conn = New ADODB.Connection
conn.CursorLocation = adUseClient 'SERVER-SIDE NOT RECCOMENDED
conn.ConnectionString = "DRIVER={MySQL ODBC 5.2w Driver};" _
& "SERVER=localhost;" _
& "DATABASE=data;" _
& "UID=root;" _
& "PWD=pass;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 163841 'SET ALL PARAMETERS
conn.Open 'THESE OPTION VALUES ARE BEST FOR VB
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM user_data", conn, adOpenStatic, adLockReadOnly
End Sub
Oke Good Luck And Good Bye