Adding Records:
1. As in the earlier case Set the DatabaseName property as "C:\ex.mdb", now Set the Record Source for the data control as Customer and Set the Record Type to 0.
2. Design a form with 5 text boxes and 2 command buttons new and update.
3. Put the DataSource to Data1 for all the text boxes.
4. Place the DataField property for each and every text box to the various fields of the Customer table.
5. Handle the Click event for new command button and type the handler as shown below:
data1.RecordSource = "Customer"
data1.Refresh
data1.Recordset.AddNew
Now Add New adds a buffer in the memory for a new record.
6. Handle the Click event for the command button, update it and type the handler as shown below:
data1.Recordset("Id") = CInt(text1.Text)
data1.Recordset("name")= text2.Text
data1.Recordset("address")= text3.Text
data1.Recordset("city")= text4.Text
data1.Recordset("state")= text5.Text
data1.Recordset.Update
Now update marks the record into the database.