DAO (DATA ACCESS OPTIONS)
Visual Basic provides a variety of options to access remote client/server databases
They are
1. Data Access Objects (DAO)
2. Data Control
3. ODBC direct
4. Remote Data Objects (RTO)
5. Remote Data Control (RDC)
6. Open Database Connectivity (ODBC)
7. Visual Basic Library for SQL Server (VBSQL)
8. Active Data Objects
Data Access Objects (DAO)
It is an Application Program Interface (API)
It is available with Microsoft Visual Basic lets a programmer request access to a
Microsoft Access database.
It can also access other Structure Query Language (SQL) database
It communicates with data sources through the JET (Joint Engine Technology)
database engine.
JET is a database engine on which several Microsoft products have been built.
A collection of information stored on a computer in a systematic way.
DAO API VB JET MS Access
Data Control
It is a Visual object that said to be data aware.
It may include checkboxes, images, labels, picture boxes, and text boxes.
It binds data-aware controls to Microsoft Access and Other ODBC Data sources.
ODBC direct
It allows accessing of ODBC data sources through the RDO with DAO objects,
bypassing the JET database engine.
Remote Data Objects (RTO)
It provides a framework for using code to create and manipulate components of a
remote ODBC database system
Remote Data Control (RDC)
It binds the controls to an ODBC Remote database
Open Database Connectivity (ODBC)
This is an API call interface to the open database connectivity libraries and drivers to
provide data access to Oracle and other databases that provide an ODBC driver.
Visual Basic Library for SQL Server (VBSQL)
It is an implementation of the DB library API specifically designed to provide access to
an SQL server through a Visual Basic application
Active Data Objects
It is an application programming Interface (API)
It is from Microsoft that allows a programmer writing windows application gets access
to the relational or nonrelational database from Microsoft and other database providers.
ODBC
Open DataBase Connectivity”
A standard software API(Application Programming Interface) specification for using
database management systems (DBMS)
A component of Windows Open Services Architecture
Independent of any programming language, database system, and operating system
Goal of ODBC
Access any data from any application, regardless of which DBMS is handling the data
Insert a middle layer(database driver) between an application and the database
management system (DBMS)
A database driver
This layer translates the application's data queries into commands that the DBMS
understands
Allow application programs to use SQL to access data from any kinds of sources
ODBC Components
ODBC Application
ODBC Driver
ODBC Driver Manager
ODBC Data Source
ODBC Application (Front-end client)
Defines and performs the work to be accomplished
Requests and terminates a session with a data source
Calls API functions that submit SQL statements
Defines storage areas and data formats for the results
Processes errors and retrieves results
Any program that accesses a DBMS, such as a spreadsheet, VB, a mail server, or a
report generator, can be designed to use ODBC
ODBC Driver (Back-end server)
A dynamic link library (DLL)
Processes ODBC function calls
Establishes a connection to a data source
Submits SQL requests to a data source
Passes the results to the application
Transforms the application’s SQL syntax into the syntax expected by the driver’s
associated DBMS
ODBC Driver Manager
A dynamic link library (DLL)
The link between an ODBC application and an ODBC driver
Loads drivers on behalf of an application
Maps a data source name to a specific driver DLL
ODBC Data Source
The data to be accessed
Also includes the associated operating system, DBMS, network platform, and the
required protocol
Examples of ODBC in use
Visual Basic front-end accessing data from a dBASE back-end using dBASE ODBC
Driver
o Part of MS ODBC Database Drivers Pack
REMOTE DATA OBJECTS
Remote Data Objects (abbreviated RDO) is an obsolete data access application
programming interface primarily used in Microsoft Visual Basic applications on Windows 95
and later operating systems. This includes database connection, queries, stored procedures,
result manipulation, and change commits. It allowed developers to create interfaces that can
directly interact with Open Database Connectivity (ODBC) data sources on remote machines,
without having to deal with the comparatively complex ODBC API.
Remote Data Objects was included with versions 4, 5, and 6 of Visual Basic; the final version
of RDO is version 2.0.
An example program using Adodc connectivity Vb with MS Access for employee details
Step1: Create the database with the name emp.mdb in MSACCESS (by saving 2002-2003
format in ms access).
Step2: Create the table with the fields Empno, Empname, designation, designation, and
Basic.
Step3: Add the details in the table
Step4: Goto Control Panel->System and Security=>Administrative Tools => select data
sources (ODBC)
Step5: select data sources (ODBC)=> MS Access Database
Step6: Create a new Data source using by selecting Driver do Microsoft Access (.mdb)
Step7: Enter the data source name in the following screen and select the database file (.mdb)
Step8: Select the database file (.mdb) and select ok button
Step9: Design the form along with ADODC tool as per given figure
Step10: Select the Adodc in form1 and select its properties to add the data source in vb
Step11: Add the table name by selecting recordsource=>table name
Step12: change the data source and respective data field name for 5 text boxes
Step13: Add 4 buttons for add, save, delete and end
Step14: Add the coding in the 4 buttons as per given below
Step15: Now you can save the project and execute the program so that you can easily add,
delete, save and exit from the project.