Isaac
Lifelong Learner
- Local time
- Today, 11:33
- Joined
- Mar 14, 2017
- Messages
- 11,106
Was I wrong to put this in this forum? I hope you will have a little grace with me on that, as this has to do with 2 things at once...yes VBScript (for which I saw no forum), but also good old DAO, so posting it here ...
I am trying to use VBScript to get the installed version of DAO DBEngine object. Does this look like it might work for a user base which is split between having 1) Access 2010 and 2) Access 2016 ? I can only test with Access 2016
It is my understanding from research that Set DBEngine = CreateObject("DAO.DBEngine") will not work any more.
Grateful for any and all input from anyone who is knowledgeable about this.
I am trying to use VBScript to get the installed version of DAO DBEngine object. Does this look like it might work for a user base which is split between having 1) Access 2010 and 2) Access 2016 ? I can only test with Access 2016
Code:
Function DAO_DBEngine()
On Error Resume Next
'try Access 2007 (DAO Engine version 120)
Set GetDBEngine = CreateObject("DAO.DBEngine.120")
If Err.Number <> 0 Then
'try DAO version 3.6
Err.Clear
Set GetDBEngine = CreateObject("DAO.DBEngine.36")
If Err.Number <> 0 Then
Set GetDBEngine = CreateObject("DAO.DBEngine.35")
End If
End If
End Function
It is my understanding from research that Set DBEngine = CreateObject("DAO.DBEngine") will not work any more.
Grateful for any and all input from anyone who is knowledgeable about this.
Last edited: