Prior to VB6 and the introduction of ADO (ActiveX Data Objects), VB programmers wouldgenerally use DAO (Data Access Objects) to interact with local databases such as MS Accessand use RDO (Remote Data Objects) to interact with client/server databases such as Oracle andSQL Server. The concept behind Visual Basic ADO was Universal Data Access (UDA), whereone database access method could be used for any data source; it was designed to replace bothDAO and RDO. DAO remains a viable technology for interacting with MS Access databases as itis faster than ADO for that purpose; however, ADO is more flexible – using ADO, one coulddevelop a prototype database application using MS Access in the back-end, and with a "flick of the wrist" (i.e., with very little coding changes) "upsize" that same application to use Oracle or SQL Server. As far as RDO is concerned, no new versions of it have been developed beyond theversion that shipped with Visual Basic, and there are no future plans for it.In the VB4 and VB5 worlds, RDO was the main method used to interact with client/server databases. RDO works perfectly fine with VB6, so when folks migrated their VB5 applicationsover to VB6, little or no coding changes were required. However, ADO is the preferred method of database access for new VB6 applications .
About this Tutorial
This tutorial presents three small sample applications using ADO. All three applications use alocal MS Access database.
The first sample application introduces the ADO Data Control (ADODC) which demonstrates a"quick and dirty" way to connect to a remote database. The second and third applications useADO code: the second allows navigation and searching of a database table; the third allowsnavigation and updating on a database table. All three connect to an ODBC Data Source, whichmust be set up through the Windows Control Panel. How to do this is described below.
Note: If you have previously set up a DSN for the Biblio database as described in the previoustopic on RDO, you can skip the section on setting up an ODBC data source and resumehere.
Setting Up an ODBC Data Source