Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 18th, 2005, 09:34 AM
Registered User
 
Join Date: Feb 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check/Reconnect Missing References

Hello,
I have an Access MDE app that I refresh & post to a website monthly (terribly inefficient, I know).

Recently a demo of the app blew up because of a missing reference; specifically, MS DAO 3.6...

My question: Is it possible to check for a missing reference, and if necessary, to reconnnect it at runtime, from an MDE?

Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old February 20th, 2005, 11:16 AM
Friend of Wrox
 
Join Date: Nov 2004
Location: Seattle, WA, .
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can fix the problem. But the fix is for the operating system your MDE is running on, not for your MDE. This is because the MDE is compiled and references are fixed (unchangeable).

To make the reference work, you must get the library that you're using registered to the operating system. Michael Kaplan has an article about this at http://www.trigeminal.com/usenet/usenet026.asp?1033

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
Reply With Quote
  #3 (permalink)  
Old February 20th, 2005, 02:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Hi Eric,

I've been playing around with Terry Kreft's open source Reference Wizard for a bit since you posted, and notice that the article Randall posted contains a link to it too. I think it might work for you.

The link for the reference wizard is at http://www.mvps.org/access/modules/mdl0022.htm.

I've been able to use it to repair a broken reference to the DAO library in a 2K2 database. Here's how I went about it.

1. The Reference Wizard is a MDA library in A97 format. So I first converted it to A2K2 format, then created an MDB in A2K2 format to host the MDA.

2. The first thing you want to do is convert the MDA to an MDE. Otherwise you won't be able to convert the host MDB to an MDE after setting a reference to the converted MDA.

Before you convert the Wizard to an MDE, however, add a new standard module to it named "basOpenForm". Add this code to the standard module:

Sub OpenForm(frmName As String)
    DoCmd.OpenForm frmName, , , , , acDialog
End Sub

This will allow you to open forms in the MDA by calling them from MDB code. The form in the Wizard you are interested in is named "wzfrm_USysRefInfo". This form uses a callback function to populate a list box with the references set in the host MDB application. If any references .IsBroken property returns True, the broken reference will be listed and flagged in the list box. "wzfrm_USysRefInfo" includes two command buttons that enable you to Repair the broken references and Refresh the references by reading/creating registry keys. Once you have basOpenForm added to the MDA, recompile it to be sure you don't have compilation errors that would prevent an MDE from being created, then create the MDE version of the Wizard.

3. After you get the Reference Wizard converted to an MDE, open your host MDB's VBA editor and set a reference to the MDE version of the Reference Wizard (just as you would set a reference to any other class library). Create a new form in the host MDB that will enable you to invoke "wzfrm_USysRefInfo" from a command button. Add the following code in the command buttons OnClick event:

Private Sub Command0_Click()
    Call OpenForm("wzfrm_USysRefInfo")
End Sub

This routine calls into the referenced MDE version of the Wizard and loads "wzfrm_USysRefInfo" in the host MDB.

4. Once the MDB is working OK with the MDE version of the Wizard, create a MDE version of the host MDB application.

At this point you should be good to go. Of course, the only method I had available to test reparing the broken DAO reference was to physically move the dao360.dll from the C:\Program Files\Common Files\Microsoft Shared\DAO folder, open the app, check to see that the broken reference was listed (it was), place the DAO dll back in its shared folder, and click the Repair button on wzfrm_USysRefInfo (the reference to DAO was repaired correctly).

So there you have it if you feel like playing around with an MDA for a bit and distributing it with your MDE app.

HTH,

Bob

Reply With Quote
  #4 (permalink)  
Old February 20th, 2005, 02:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

And just to clean up my little blunders:

I wrote:

"The first thing you want to do is convert the MDA to an MDE. Otherwise you won't be able to convert the host MDB to an MDE after setting a reference to the converted MDA."

Should read:

"The first thing you want to do is convert the MDA to an MDE. Otherwise you won't be able to convert the host MDB to an MDE after setting a reference to the unconverted MDA."

Bob


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to VSS check-in Check-out Programatically rhd110 General .NET 6 August 12th, 2007 07:46 AM
Check for missing input g2000 Classic ASP Basics 3 September 1st, 2005 06:05 PM
references emmgus XSLT 2 August 4th, 2005 01:20 PM
Please help for references rsjaladi Classic ASP Databases 1 November 27th, 2004 04:04 AM



All times are GMT -4. The time now is 12:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.