UtterAccess.com
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
> Library Missing Error When Connecting To 2016 Database From 2013 Client, Access 2016    
 
   
ScottyBee
post Oct 31 2019, 12:51 PM
Post#1



Posts: 53
Joined: 6-June 05
From: Portland Oregon


Hello Everyone,

I recently upgraded my work computer to Office 2016 from 2013 and did not take into account potential problems for an Access database I have developed. I have a database stored locally on my computer where I will be granting access to a few users who still have Access 2013. I went to test the computer from another PC that has Access 2013.

I wasn't able to change any data on the default form and got error "cannot save record at this time." After doing a little more digging, I noted that when I opened Tools, References in the code window on this client computer, I saw the following screen:

Attached File  Access_Error_Missing_References.JPG ( 46.52K )Number of downloads: 1


Access 2016 apparently uses Microsoft Object Library 16.0 and Access 2013 uses Microsoft Object Library 15. It looks like I will have to revert back to Object Library 15.0 so users of Access 2013 can use my database. I noticed that under "Save As" there is no option to save my 2016 database in 2013 format?

Any suggestions? Thanks





Attached File(s)
Attached File  Access_Error_Missing_References.JPG ( 46.52K )Number of downloads: 2
 
Go to the top of the page
 
theDBguy
post Oct 31 2019, 12:58 PM
Post#2


UA Moderator
Posts: 76,898
Joined: 19-June 07
From: SunnySandyEggo


Hi. You can just go back to a 2013 machine and redo the references or convert your code to use late binding.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
GroverParkGeorge
post Oct 31 2019, 01:00 PM
Post#3


UA Admin
Posts: 36,203
Joined: 20-June 02
From: Newcastle, WA


That's a problem most Access developers eventually encounter as they upgrade from version to version.

You need to develop (or at least prepare for deployment) on a computer with the EARLIEST version that will be used by any of your users. In this case, it sounds like you need to do this in Access 2013 because that's what your users have.

An alternative is called Late Binding. It might be a better option.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
jleach
post Nov 1 2019, 07:20 AM
Post#4


UtterAccess Administrator
Posts: 10,281
Joined: 7-December 09
From: St. Augustine, FL


I'll third that Late Binding is the preferred route when working with libraries that you don't need version-specific functionality and intellisense for (or, develop using early binding, then as a pre-deploy step, convert to late binding - this can be done fairly easily with a "mode" setting (e.g., dev, test, prod) and conditional compilation).

Also, I'll agree that a pre-deploy build using the earliest supported version is an excellent idea.

Cheers,

--------------------
Jack D. Leach
Founder & CEO
Dymeng Services Inc.
Business Software Solutions
Go to the top of the page
 
ScottyBee
post Nov 1 2019, 02:56 PM
Post#5



Posts: 53
Joined: 6-June 05
From: Portland Oregon


Thanks everyone for the three replies. I went with theDBGuys suggestion as it was easiest to implement. However, as I dive into Access programming further, I do see that understanding and implementing early vs. late binding will be helpful. I did view the hyperlink that GroverParkGeore posted and had a few questions to hopefully help me understand this concept:

1. To transform my code from early binding to late binding, do I just need to declare general object variables instead of specific object types such as in the example below? (This is an example I found for Excel)

CODE
In late binding, variables are defined as Object instead of the strongly typed data type for an object. For example, if you were automating objects in the Excel 2007 object model, you might have code that looks something like this:

Dim objXL     As Excel.Application
Dim objBook     As Excel.Workbook
Dim objSheet     As Excel.Worksheet
' Launch Excel
Set objXL = New Excel.Application

With late binding, this becomes:

Dim objXL     As Object ' Excel.Application
Dim objBook     As Object ' Excel.Workbook
Dim objSheet     As Object ' Excel.Worksheet
' Launch Excel
Set objXL = CreateObject("Excel.Application")


2. From your replies, it sounds like there is more to late binding than just the above. Do I put some code in my startup form that runs automatically to implement early or late binding?

3. I also saw some information about conditional binding where you tell Access to do one or the other. Where would this code go in my database and what might it look like? Thanks for your help. Don't need to fully understand this concept now but would like to use it for future projects. smile.gif

Go to the top of the page
 
jleach
post Nov 1 2019, 03:07 PM
Post#6


UtterAccess Administrator
Posts: 10,281
Joined: 7-December 09
From: St. Augustine, FL


Your example is right on: that's all that's really required.

The other stuff can be helpful for build/deploy processes, but aren't really necessary.

Late binding is relatively straighforward to implement (although you should understand that it's going to pick up whatever version is available on the client machine where it's running, so stick to generic, well-cross-supported features when you're coding with late binding).

No specific need to get into conditional compilation to use it.

Cheers,

--------------------
Jack D. Leach
Founder & CEO
Dymeng Services Inc.
Business Software Solutions
Go to the top of the page
 
cheekybuddha
post Nov 1 2019, 07:29 PM
Post#7


UtterAccess Moderator
Posts: 11,916
Joined: 6-December 03
From: Telegraph Hill


The other thing to remember is that you need to find out the numeric values of constants and substitute or re-declare them.

--------------------


Regards,

David Marten
Go to the top of the page
 
jleach
post Nov 1 2019, 08:03 PM
Post#8


UtterAccess Administrator
Posts: 10,281
Joined: 7-December 09
From: St. Augustine, FL


>> find out the numeric values of constants and substitute or re-declare <<

This is one of the areas that conditional compilation is helpful.

It's been a quite a few years since I've worked with Outlook or CC in VBA, so I'm quite certain my off-the-cuff example below will be a syntactic disaster, but for general concept:

CODE
Option Compare Database
Option Explicit

#Const LATE_BIND = True

#IF LATE_BIND = True Then
  olMailItem = 1
  olSomethingElse = 2
#END IF

Public Function DoSomethingWithOutlook()

  #IF LATE_BIND
     Dim ol As Object, ml As Object
     Set ol = CreateObject("Outlook.Application")
  #ELSE
    Dim ol AS Outlook.Application, ml As Outlook.MailItem
    Set ol = new Outlook.Application
  #END IF

  Set ml = ol.CreateMailItem()
  ml.Something = olSomethingElse

  'blah blah
End Function


Of course the code is a mess, but the idea is:

- the "ol" constants will be defined if early bound, but if late binding, we'll declare them here, so we can use the same named constants in code, instead of hardcoding magic numbers. This also allows us to not change later usage of them if we switch between early and late binding
- the "ol" and "ml" objects are either typed or generic depending on whether we're using early or late binding, respectively. Either way, later usage of them in the function works because ultimately they're the same type of object. With early binding, the compiler/VBE knows what the object model is, so you get intellisense and generally it's easier to work with while developing.

If you want to switch between early and late binding, change the #LATE_BIND constant accordingly.

Note: all declarations and special if statements that start with # are conditionally compiled: that's how this works.

(also note that Outlook isn't quite instantiated that way, but for high-level concept demonstration, it works)


So, you do your development using early binding for ease of coding and testing, and before deploying you switch to late binding for more robust linkage.

The particularly important part is to realize that while you may develop using Outlook 16.0 reference, on the client where the late binding runs, it might pull up version 15, or 14 or 19 or whatever. So, late binding - in a way - is a bit dangerous unless you're careful about utilizing library features that are assumed to be present on other client machines. Luckily, there's often very little changes to core object model stuff between versions, so long as we stick to the basics of working with those libraries (which is really a good practice in any programming, IMNSHO: I'll argue that point vehemently!).


See also: https://www.UtterAccess.com/wiki/Conditional_Compilation

Cheers,

--------------------
Jack D. Leach
Founder & CEO
Dymeng Services Inc.
Business Software Solutions
Go to the top of the page
 
DanielPineault
post Nov 2 2019, 03:57 AM
Post#9


UtterAccess VIP
Posts: 7,014
Joined: 30-June 11



The following links may be useful to you

https://www.devhut.net/2016/07/07/vba-automating-excel/
https://www.devhut.net/2016/11/08/vba-early...d-late-binding/
https://www.devhut.net/2017/02/16/vba-early...binding-part-2/
https://www.devhut.net/2017/03/15/ms-access...rdset-to-excel/ (just as an example)

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
ScottyBee
post Nov 4 2019, 01:13 PM
Post#10



Posts: 53
Joined: 6-June 05
From: Portland Oregon


Thanks gentlemen for the great information. This will be very helpful for my Access coding projects in the future. smile.gif
Go to the top of the page
 
theDBguy
post Nov 4 2019, 01:26 PM
Post#11


UA Moderator
Posts: 76,898
Joined: 19-June 07
From: SunnySandyEggo


Good luck! thumbup.gif

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    14th December 2019 - 10:44 AM