X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Set Database Error In Excel VBA, Office 2013    
post Oct 11 2018, 09:52 AM

Posts: 197
Joined: 16-August 12

Hi all. I updated an Access database form an older version and it now has the .accdb extension versus the .mdb.

I updated the VB code in Excel where it's pointing to the database but getting an error on the following bolded section. Thinking it's because I converted to .accdb and it should be ADO instead of DAO but not sure what the proper code would be?

idrive = "\\cdtvnas13\ops"
dbname = idrive & "\VERIFY1\DDDSUP3.ACCDB"
Set db = DAO.DBEngine.Workspaces(0).OpenDatabase(dbname)

Go to the top of the page
Doug Steele
post Oct 11 2018, 10:00 AM

UtterAccess VIP
Posts: 22,307
Joined: 8-January 07
From: St. Catharines, ON (Canada)

I believe all you need is

  Set db = DAO.DBEngine.OpenDatabase(dbname)

Doug Steele, Microsoft Access MVP (2000-2018)
Personal webpage
Microsoft profile
Co-author: Access Solutions: Tips, Tricks, and Secrets from Microsoft Access MVPs, published by Wiley
Co-author: Effective SQL: 61 Specific Ways to Write Better SQL, published by Addison-Wesley Professional
Technical Editor: Access 2010 Bible, Access 2013 Bible, Access 2016 Bible, all published by Wiley
Technical Editor: SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition, published by Addison-Wesley Professional
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    7th August 2020 - 02:12 PM