Click to See Complete Forum and Search --> : Update database record


qiaojun
July 2nd, 2001, 01:57 PM
Everthing has ben settled, VB6 can interact with the inventory database by Access 97. One of the table is Employee. What code shall i write in order to perform Add, Delete, Edit, Update, or Discard?
Please teach me or let me know if there is any website teaching so.

Iouri
July 2nd, 2001, 03:34 PM
After you have created connection object to the database you can execute an SQl there.

sSQL = "delete * from Table"

cn.Execut sSQL




Iouri Boutchkine
iouri@hotsheet.com

Robert Moy
July 3rd, 2001, 07:18 PM
Hello:

You can use ADO to do it:

Private Sub Command1_Click()
Adodc1.Recordset.AddNew
End Sub

Private Sub Command2_Click()
Adodc1.Recordset.Delete
End Sub

Private Sub Command3_Click()
Adodc1.Recordset.Update
End Sub

Private Sub Command4_Click()
Adodc1.Refresh
End Sub

Private Sub Command5_Click()
Adodc1.Recordset.Find "DIVISION = 'eleven'"
End Sub

After you have click on a delete, addnew, and update, you got to click refresh button.

Good Luck.
I hope this helps.