Problem:The code works but every time i input a username and password it doesn't add up to my database which i created from MS Access. I tried using the code for registration and it works just fine but if i put 2 more forms it doesn't add up to my database.
Thanks
Code for Menu form:
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click Dim x as Form1 = New Form1 x.Hide() me.Show() End Sub End Class Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button2.Click Dim y as Form2 = New Form2 y.Hide() me.Show() End Sub End Class Private Sub Button2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button2.Click Dispose() End Sub End Class
Code for registration:
Private Sub Form2_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)
Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)
Handles Button1.Click
Try
cn = New OleDbConnection("Provider=Microsoft.Jet >OLEDB.4.0;Data Source=D:\megaera\data.mdb;")
cn.Open()
str = "insert into table1 values("&Textbox1.Text&",'"&Textbox1.Text&"')"
cmd = New OleDbCommand(str,cn)
MessageBox.Show("Registration Success!!")
Catch
End Try
cn.Close()
End Sub
End Class
I'm still searching for a code for the log-in form.

New Topic/Question
Reply




MultiQuote




|