DAO connect Access 2007/2010

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

DAO connect Access 2007/2010

Post by sal21 »

How to connect .accb, with VB6 and DAO using Workspace?
Tks.

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: DAO connect Access 2007/2010

Post by HansV »

You have to set a reference to the Microsoft Office 12.0 Access Database Engine Object Library (for Access 2007) or the Microsoft Office 14.0 Access Database Engine Object Library (for Access 2010). You can then use DAO exactly the same way as you are used to.
S136.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: DAO connect Access 2007/2010

Post by sal21 »

HansV wrote:You have to set a reference to the Microsoft Office 12.0 Access Database Engine Object Library (for Access 2007) or the Microsoft Office 14.0 Access Database Engine Object Library (for Access 2010). You can then use DAO exactly the same way as you are used to.
S136.png
Set the reference....

i use:
Option Explicit
Sub UNO()

Dim dbMyDB As DAO.Database, RS As DAO.Recordset

Set dbMyDB = OpenDatabase("C:\DATABASE\T3541.accdb", False, False)

End Sub

correct?

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: DAO connect Access 2007/2010

Post by HansV »

Yes, that should work.
Best wishes,
Hans