u need to use queries to insert data.
eg.
u begin with establishing a connection with the statement
dim oledbcon As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\abc.accdb;Persist Security Info = false;")
u then open the connection using the statement
oledbcon.open
insert query
oledbcom.CommandText = ("INSERT INTO Customer (Company, Address, Telephone) values (?,?,?)")
oledbcom.Connection = oledbcon
adding the parameters.
each question mark in the above statement indicates a parameter.
Dim oledbparam As OleDb.OleDbParameter = _
oledbcom.Parameters.Add("@Company", OleDb.OleDbType.VarChar, 30)
oledbparam.Value = txtCompName.Text.Trim()
oledbparam = oledbcom.Parameters.Add("@Address", OleDb.OleDbType.VarChar, 80)
oledbparam.Value = txtAddress.Text.Trim
oledbparam = oledbcom.Parameters.Add("@Telephone", OleDb.OleDbType.VarChar, 15)
oledbparam.Value = txtContact.Text.Trim
execute the query
oledbcom.ExecuteNonQuery()
close the connection using
oledbcon.close