Search code examples
sql-servervbams-accessdaoms-access-2016

Explicit declaration of aceDAO recordset in Microsoft Access 2016 VBA


I have project that uses Microsoft SQL Server 2012 Express as backend and Access 2016 as front-end. My previous code was in Access 2003 and SQL Server 2000 database. Now I migrated backend to SQL Server 2012 Express. Also converted the .mdb to .accdb file format. I had recordsets of DAO as well as ADO in my project. The software is installed on several nodes at my client's place. To make it easier for the recordset declaration I used DAO.recordset and ADO.Recordset, I do have DAO reference prior to ADO reference in the reference window of VBA code. But now when I upgraded to Access 2016 I wanted to use aceDAO recordset instead of DAO.

I am trying to find-out explicit declaration syntax for aceDAO recordset I tried

Dim recPayment as aceDAO.Recordset 

I am getting compile error "User-defined type not defined"

I can not rely on priority of references in reference window of VBA, sometimes they are changed at client's machine if something is broken. And this will surely give me problem.


Solution

  • The object type is DAO and the reference is Microsoft Office 16.0 Access database engine Object Library.