ABSTRACT

This chapter implements a simple tool in Visual Basic for Applications (VBA) to extract variable annuity contracts from an Access® database that are issued in a particular year. This tool also allows us to save extracted contracts into a new table in the database. The chapter explains the following objects of ActiveX Data Objects (ADO): the Connection object, the RecordSet object, and the Command object. The Connection object is used to establish a connection between Excel and a database. The RecordSet object is used to retrieve a single record or multiple records from a database table. The chapter introduces how to connect to a Microsoft Access database in Excel VBA. In particular, it also introduces how to retrieve data from an Access database to Excel, how to create tables in Access, and how to transport data in Excel to an Access database.