CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2001
    Posts
    29

    Update database record

    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.


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Update database record

    After you have created connection object to the database you can execute an SQl there.

    sSQL = "delete * from Table"

    cn.Execut sSQL




    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Feb 2001
    Posts
    54

    Re: Update database record

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured