Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds As New DataSet
Dim da As New OleDbDataAdapter
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim cn As New OleDbConnection
Dim cmd As OleDbCommand
Dim sql As String
'sql = "INSERT INTO Employees(GivenName, LastName, Gender, JobPosition, Month, Day, " & _
'"Address, EmailAddress, )"
sql = "INSERT INTO Employees(GivenName) where GivenName='" & txtGivenName.Text
sql = "INSERT INTO Employees(LastName) where LastName='" & txtLastName.Text
sql = "INSERT INTO Employees(Gender) where Gender='" & cmbGender.Text
sql = "INSERT INTO Employees(JobPosition) where JobPosition='" & cmbJobPos.Text
sql = "INSERT INTO Employees(Month) where Month='" & cmbMonth.Text
sql = "INSERT INTO Employees(Day) where Day='" & cmbDay.Text
sql = "INSERT INTO Employees(Year) where Year='" & cmbYear.Text
sql = "INSERT INTO Employees(Address) where Address='" & txtAddress.Text
sql = "INSERT INTO Employees(EmailAddress) where EmailAddress='" & txtEmailAddress.Text
sql = "INSERT INTO Employees(Username) where Username='" & txtUsername.Text
sql = "INSERT INTO Employees([Password]) where [Password]='" & txtPassword.Text
sql = "INSERT INTO Employees(SecretQ1) where SecretQ1='" & cmbSecretQ1.Text
sql = "INSERT INTO Employees(SecretQ2) where SecretQ2='" & cmbSecretQ2.Text
sql = "INSERT INTO Employees(SecretA1) values('" & txtSecretA1.Text '")
sql = "INSERT INTO Employees(SecretA2) values(‘" & txtSecretA2.Text "')"
If txtConfirmPW.Text <> txtPassword.Text Then
MessageBox.Show("The password does not match!")
End If
cn.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0; data source=C:\Documents and Settings\James\My Documents\MSN Pharmacy\msn_pharmacy.mdb"
cn.Open()
da = New OleDb.OleDbDataAdapter(sql, cn)
cmd = New OleDbCommand(sql, cn)
Dim dr As OleDbDataReader = cmd.ExecuteReader
SuccessRegister.ShowDialog()
Profile.Show()
Me.Hide()
End Sub
My SQL skills are a bit rusty, and I so far remember about SELECT, not yet in INSERT, INSERT INTO, and UPDATE. I dunno if am I doing the code right, especially in adding data based on what's typed in the text boxes.