DAO in VB .NET MS ACCESS Database

How to connect Access Database using DAO In VB  .Net

vb .net DAO
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.

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
vb .net Dao 360 dll reference

Code

Imports DAO
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
And you have just connected your database *.mdb in vb.Net Using DAO 3.61

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 :

Popular posts from this blog

Visual Basic Online Courses DataGridView Add Edit Delete

VB .NET WebView2 WinForms tips

VB .NET Google Drive Api Source Code Example

VB NET Check internet connection

Visual Basic 2010 Working With DataBase Full Project Example

Visual Basic 2010 Math Functions