Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 8

Updating a Record using Recorset's Update Control in VB6

To write the contents of a Recordset object's copy buffer to its underlying data, you must follow these steps:
  1. Write to each field in the copy buffer, as described in the preceding section.

  2. Call the Recordset's Update method.

Listing 8.6 illustrates using these steps to update a record. To review the purpose of the WriteEmployeeRecord procedure, refer to the above section, "Programmatically Writing VB Controls to a Record."

LISTING 8.6
ROUTINES FOR WRITING DATA FROM CONTROLS BACK TO THE DATABASE

Sub UpdateRecord
'write controls to buffer
WriteEmployeeRecord
'call the Update method
rsEmployees.Update
End Sub
Sub WriteEmployeeRecord()
rsEmployees![First Name] = txtFirstName.Text
rsEmployees![Last Name] = txtLastName.Text
rsEmployees!Department = txtDepartment.Text
rsEmployees!PhoneExt = txtPhoneExt.Text
rsEmployee![Full Time]= chkFullTime.Value
End Sub

See Also


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved