Tutorial Vb.Net : Form Login dengan Database MySQL

Tutorial Vb.Net membuat Form login visual basic net 2010 dengan database MySQL menggunakan module koneksi.vb dengan mudah

Cara mudah Membuat Form Login VB.Net 2010 database MySQL

Visual basic Net 2010 sudah menyiapkan Form untuk membuat Halaman Login, caranya buat module koneksi ke database menggunakan module, baca Tutorial Vb.Net : Cara Membuat Koneksi Database MySQL

Membuat Tabel Login di Database MySQL

Buatlah table login untuk menyimpan data - data yang digunakan untuk login nantinya, lihat gambar tabel login berikut :
Membuat tabel login database mysql

buatlah tabel login sesuai kebutuhan aja, jika masih ada yang bingung tentang cara membuat database, silahkan buka Cara Membuat Database MySQL

Buat Form Baru di visual basic 2010 dengan cara pada menu Project >> add Windows Form >> Login Form

Tutorial Vb.Net : Form Login dengan Database MySQL

Copy code Untuk login berikut :
Public Class FrmLogin
    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
        Dim DRlogin As Odbc.OdbcDataReader
        Dim CMDlogin As Odbc.OdbcCommand
        Dim SQL As String
        CMDlogin = New Odbc.OdbcCommand
        CMDlogin.CommandType = CommandType.Text
        CMDlogin.Connection = konek
        CMDlogin = New Odbc.OdbcCommand
        CMDlogin.CommandType = CommandType.Text
        CMDlogin.Connection = konek
        SQL = "SELECT * FROM akun_guru WHERE username = '" & UsernameTextBox.Text & "' and password=MD5('" & PasswordTextBox.Text & "')"
        CMDlogin.CommandText = SQL
        DRlogin = CMDlogin.ExecuteReader()
        If DRlogin.HasRows Then
            IDGURU = DRlogin.Item("id_guru")
            If DRlogin.Item("active") = 1 Then
                With FrmUtama
                    .Show()
                    .LoginToolStripMenuItem.Enabled = False
                    .ToolStripStatusLabel1.Text = "Selamat Datang : "
                    .ToolStripStatusLabel2.Text = IDGURU
                    .ToolStripStatusLabel2.BackColor = Color.Transparent
                    .MasterDataToolStripMenuItem.Enabled = True
                    .NILAIToolStripMenuItem.Enabled = True
                    .CetakLaporanToolStripMenuItem.Enabled = True
                    .DaftarPemakaiToolStripMenuItem.Enabled = False
                    Me.Hide()
                End With
            Else
                MsgBox("Anda tidak berhak menggunakan program ini", vbCritical, "access ditolak")
            End If
        Else
            MsgBox("Nama User atau Password salah", vbCritical, "Password Salah")
        End If
    End Sub
    Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
        Me.Close()
    End Sub
    Private Sub FrmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        bukaDB()
    End Sub
End Class
Save jika sudah disesuaikan dengan database dan nama form anda, Tekan f5 untuk menjalankan aplikasi login anda, jika password salah maka akan ada pemberitahuan "Nama User atau Password salah"


Form Login dengan Database MySQL

Jika benar maka FrmUtama.vb akan muncul. Jika masih bingung dalam tutorial membuat form login diatas, silahkan lihat video tutorialnya berikut ini :




Silahkan bertanya jika masih ada masalah di kotak komentar, terima kasih :)

COMMENTS


Feel free to code it up and send us a pull request.

Hi everyone, let's me know how much this lesson can help your work. Please Subscribe and Follow Our Social Media 'kodeajaib[dot]com' to get Latest tutorials and will be send to your email everyday for free!, Just hit a comment if you have confused. Nice to meet you and Happy coding :) all ^^



Follow by E-Mail


Name

ADO.NET,3,Ajax,6,Android,9,AngularJS,4,ASP.NET,4,Blogger Tutorials,7,Bootstrap,7,C++,1,Codeigniter,2,Cplusplus,6,Crystal Report,6,CSharp,25,Ebook Java,2,FlyExam,1,FSharp,3,Game Development,2,Java,35,JDBC,2,Laravel,84,Lumen,2,MariaDB,2,Ms Access,3,MySQL,31,ODBC,6,OleDB,1,PHP,14,PHP Framework,5,PHP MYSQLI,9,PHP OOP,5,Python,8,Python 3,4,SQL Server,4,SQLite,4,Uncategorized,5,Vb 6,2,Vb.Net,89,Video,48,Vue Js,4,WPF,2,Yii,3,
ltr
item
KODE AJAIB: Tutorial Vb.Net : Form Login dengan Database MySQL
Tutorial Vb.Net : Form Login dengan Database MySQL
Tutorial Vb.Net membuat Form login visual basic net 2010 dengan database MySQL menggunakan module koneksi.vb dengan mudah
https://3.bp.blogspot.com/-DUPCuDQX4Vw/VQLYaXoATLI/AAAAAAAAADQ/s_9Vg0fDZNA/s1600/membuat-table-login-database-mysql.png
https://3.bp.blogspot.com/-DUPCuDQX4Vw/VQLYaXoATLI/AAAAAAAAADQ/s_9Vg0fDZNA/s72-c/membuat-table-login-database-mysql.png
KODE AJAIB
https://www.phpsync.com/2015/03/tutorial-vbnet-form-login-database-mysql.html
https://www.phpsync.com/
https://www.phpsync.com/
https://www.phpsync.com/2015/03/tutorial-vbnet-form-login-database-mysql.html
true
3214704946184383982
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy