Folks: I got rid of the error now.. this is my code..pls take a look at the button1_click function! i dont see any data being entered into my database. :( Your guidance will be very helpful!
Thanks,
Kukki.
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objcmd As New Data.OleDb.OleDbCommand
Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection("provider=microsoft.jet.OLEDB.4.0; data source=C:\Documents and Settings\bashkark\Desktop\USERS.mdb")
Button1.BackColor = System.Drawing.Color.CornflowerBlue
Button2.BackColor = System.Drawing.Color.Bisque
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New OleDb.OleDbConnection
Dim cmd As OleDb.OleDbCommand
Dim icount As Integer
Dim str As String
Try
con = New OleDb.OleDbConnection("provider=microsoft.jet.OLEDB.4.0; data source=C:\Documents and Settings\bashkark\Desktop\USERS.mdb")
con.Open()
str = "insert into table1 values('" & TextBox1.Text & "', '" & TextBox2.Text & "', '" & TextBox3.Text & "', '" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "', '" & TextBox7.Text & "','" & TextBox8.Text & "', '" & TextBox9.Text & "','" & TextBox10.Text & "','" & TextBox11.Text & "','" & TextBox12.Text & "','" & TextBox13.Text & "','" & TextBox14.Text & "','" & TextBox15.Text & "','" & TextBox16.Text & "','" & TextBox17.Text & "')"
cmd = New OleDb.OleDbCommand(str, con)
icount = cmd.ExecuteNonQuery
MessageBox.Show(icount)
Catch
End Try
con.Close()
End Sub
End Class