Solved

How to troubleshoot Access Runtime issues

Posted on 2015-02-01
6
172 Views
Last Modified: 2016-02-11
I have a database created in 2010 that requires getting a value from a certain key in the registry.  This value is the path to the file where the backend tables are stored.  At the startup, the application finds the key in the registry and then refreshes links to the tables.  Well, this process works great in a standard database but when we convert it (a customer requirement) to the runtime it breaks.  I have error handling in place but a message box pops up no err.description.  The whole program closes.  What can I try next.
0
Comment
Question by:EugeneDozier
6 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40582820
Are you distributing the Runtime version to the same operating system as the development system?
0
 

Author Comment

by:EugeneDozier
ID: 40582830
Good question, I'm not sure.  I'm developing it on a Windows 7 machine.  I will have to check what the end user has but I have tested on a Windows Vista machine and it does not work.

Eugene
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 40582837
I don't like using the registry for anything.  Especially since in some companies, individuals cannot modify the registry.

You can identify the path to the back end by using the MSysObjects table.  Be careful though.  If you have linked spreadsheets, you will need to use the type column to get just the Jet/ACE tables.MSysObjects query
SELECT MSysObjects.Database, MSysObjects.Name, MSysObjects.ForeignName, MSysObjects.Type, MSysObjects.Flags
FROM MSysObjects
WHERE (((MSysObjects.Type)=6))
ORDER BY MSysObjects.Name, MSysObjects.ForeignName;
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:EugeneDozier
ID: 40582847
Thanks Pat.  I don't like to use the registry either but in this case it was a customer requirement.  Your solution looks interesting but I not sure if it will fly with my customer.  I will have to check.  Do you have any ideas with regards to the registry path?
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 40582863
Once the tables are linked, you can always find the path this way.  I think the customer may be worried about initial installs or perhaps inconsistent drive mappings.  When I am working on an app that will be distributed in-house, I always link to the BE using the UNC name.  So if you look at the list I posted, you will see that some links are \\newfiscal\... and some are C:\...  This is a picture from my test version which is the only reason there is a mix.  The ones that are linked to production are not updated so I don't bother to relink them in my test version.  I only relink the tables that get updated so those are C:\...  So, as long as the BE is linked using the UNC method, I don't have to worry about each user having a consistent drive mapped.  In some shops that is a real problem.

When I create an app that is sold to the public, I don't attempt to control where the BE is located.  My install, puts it where I expect it to be but I don't force the issue.  I have the admin link the initial copy and distribute the linked copy to the other users.  In this case though, I insist on a consistently mapped drive.
0
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 500 total points
ID: 40583832
Hi,

I often read "I have error handling" but after looking into the code there is none or wrong handled. In fact, you need for example a "resume" command to end the error handling, otherwise the error is thrown to the calling procedure and that means this one must stop the error from walking through the calling stack (or any procedure above).

It would be good if you could show the code you use for error handling and even better if you can show the code which causes the crash. The Runtime always crashes when an error is not handled.

Regarding the registry: You can simply use the "GetSetting"/"SaveSetting" procedures of VBA to read from and write to the registry - there is a special key in the registry where these values are saved (different on different operating systems) which is always accessible by any user as these procedures cannot use any other registry keys than this base key. So you have the possibility to use the registry and on the other hand you can manipulate the keys from outside through a group policy or anything like that so the customer can change the place where the backend is stored.

Cheers,

Christian
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now