• Increase font size
  • Default font size
  • Decrease font size

How to Save Image into MS-Access 2003 from Visual Basic 6?

E-mail Print PDF
This article is a sample of saving image from Visual Basic 6 into Microsoft Access Database.
  • Create New Project in VB6: Project1
  • Create New Form: Form1
  • Draw Controls on Form as following:
    • One TextBox Control
    • One Image Control
    • Two Command Controls for Save and Close
    • Two Command Controls for Browse and Remove Image
    • One Command Control to Get data back from Database with the text enter TextBox Control
  • Add Component: Microsoft Command Dialog Control 6.0
  • See Image below
  • Add Reference: Microsoft ActiveX Data Objects 2.1 Library (Project->References)
  • Create Database in Microsoft Access (data.mdb) with the following table:
    • Table name: student
    • Fields
      FieldData Type
      photoOLE Object
  • Coding (Download sample below)

Download Sample Code Here