?
Solved

Access library reference broken - ideas needed

Posted on 2014-03-23
5
Medium Priority
?
331 Views
Last Modified: 2014-03-23
Dear experts -
We have a new form that is used only by 2 users (out of 15); but that form uses a special library based on special software installed on those local machines.
So, when we put the database on the server, users who don't have that library can't run the application, they get a broken library reference.
How can I solve this?
I like having everything in one application, so the idea of splitting off a small app for the 2 users is a bit of a pain and a little less easy to manage.
Any ideas?
Thanks!
0
Comment
Question by:terpsichore
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:ChloesDad
ID: 39948670
When you add a reference to a dll in an application, it checks for all being available on start-up. If one isn't then you get an error.

You have the following solutions

1 Install the special software on all machines
2 copy the required dlls to the database folder so that the program can see them
3 Split this feature to a separate program
0
 
LVL 58
ID: 39948671
<<Any ideas?>>

 Use late binding for deployment.   ie. instead of for example:

Dim objOutlook as Outlook.Application

you do:

Dim objOutlook as Object

By dim'ing it as a generic object, you won't have a problem with the reference because you don't need one.

  You can then use GetObject()/CreateObject() to try creating an instance, and if an error, trap the error.

Here's a little more on binding in general if your interested in some details:

Using early binding and late binding in Automation
http://support.microsoft.com/kb/245115

Jim.
0
 

Author Comment

by:terpsichore
ID: 39948699
Thanks, Jim -
Specifically, I am trying to add a reference to something called "Pawcom2 Library" which on the local machine will be:


How would I refer to this?
C:\Multiware\PawCom2\PawCom2.tlb

Currently there is code in modules such as the following - would this have to be changed as well?

Option Compare Database
Option Explicit

    Dim bVendor As New PawCom2.Btrieve
    Dim oVendor As New PawCom2.Vendors
    Dim bts As New PawCom2.bts
    Dim ptf As New PawCom2.ptf

Thanks!
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 39948720
It would be:

 Dim bVendor as Object

 Set bVendor = CreateObject("PawCom2.Btrieve")

<<Currently there is code in modules such as the following - would this have to be changed as well>>

  Yes, all that code would have to be changed.  In order to live without the reference, you must late bind.   By doing that, the automation objects methods and properties are not accessed until you go to use them.

 So when late binding,  you can check for existence of the app on a users machine and if not found, not execute any code that goes against it.  Result is no errors.

Jim.
0
 

Author Closing Comment

by:terpsichore
ID: 39948722
exactly what we needed. thank you.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question