DAO in VB .NET MS ACCESS Database
How to connect Access Database using DAO In VB .Net
vb .net DAO |
Data Access Object (DAO)
According to Microsoft Docs , Conversion from DAO TO ADO : Versions of the DAO library prior to 3.6 are not provided or supported in Access.
Also :
ODBCDirect workspaces are not supported in Microsoft Access 2013. Use ADO if you want to access external data sources without using the Microsoft Access database engine.
DAO is used with Access databases and is supported through Office 2013. DAO 3.6 is the final version, and it is considered obsolete. These classes work with the other application framework classes to give easy access to Data Access Object (DAO) databases, which use the same database engine as Microsoft Visual Basic and Microsoft Access. The DAO classes can also access a wide variety of databases for which Open Database Connectivity (ODBC) drivers are available. Programs that use DAO databases will have at least a CDaoDatabase object and a CDaoRecordset object.
DAO 360 dll
- Data Access Object Version 3.60
- Path : C:\WINDOWS\assembly\GAC\dao\
vb .net Project Design
- Create new visual basic Project - WinForm
- Create new MS-Access 2003 Database
Visual Basic .Net Project
- New form (Name :Form1)
- DataBase (Name : ahmed.mdb)
- Add Reference : COM => DAO 3.61
vb .net Dao 360 dll reference |
Code
Imports DAOAnd you have just connected your database *.mdb in vb.Net Using DAO 3.61
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim DB As DAO.Database
Dim DBE As New DAO.DBEngineDB = DBE.OpenDatabase("ahmed.mdb", Nothing, False, "dbase iv;")
End Sub
End Class
Using Dao 360 with Microsoft Access 2007 / 2010 / 2013 / 2019 (*.accdb)
1) How to get all Tables in a Database using DAO 360
- Create VB .Net WinForm Project
- Add Module [DaoConnection]
- Add Reference to Dao 360 dll
- Create MS Access Database 2007 / 2010 / 2013 / 2019 [db.accdb] in [C:\Databases\]
- Encrypt Database [db.accdb] with Password [MyPassword]
2) How to get all Fields in Database using Dao 360
Using the above example, this code will enumerate the Tables-> Fields -> Attributes
Code
♥ Here are some online Visual Basic lessons and courses :
- Visual Basic .Net - Create TextBox control with Event at Project Run-Time
- Visual Basic .Net - How to check for the internet connection
- Visual Basic .Net - POP3 and Receiving E-mails
- Visual Basic .Net - Generate Random Combinations
- Visual Basic .Net - Play sounds on Button Click or Mouse Hover
- Visual Basic .Net - Progressbar control
- Visual Basic .Net - The application failed to initialize
- Visual Basic .Net - Working with Database full example
- Visual Basic .Net - There is already an open DataReader associated
- Visual Basic .Net - SyBase Advantage Database [Add, Edit, Search, Delete and DataGridView]
- Visual Basic .Net - Math Functions
- Visual Basic .Net - Communicating with clients [Requirements Docs, Use-Case]
- Visual Basic .Net - Receive Emails using POP3 mail Server