Acwztool Access

0 views
Skip to first unread message

Shu Manwill

unread,
Aug 5, 2024, 3:39:10 AM8/5/24
to ensteepcente
Atmy workplace we have a 20 year old VBA Access application. We tried to buy the source code from the guy 10 years ago, but he didn't want anyone to call him. He died five years ago. I've been tasked to rewrite this application using SQL and .NET, but it would be nice to be able to see what is going on inside.

When I open the MBD file (while holding down SHIFT), I can see the tables and some queries. However, when I go to Visual Basic, I only see one blank project called master60, with no modules or forms visible. I can trick it a little bit by going to the performance analyzer, and on Current Database I select "VBA Project". Now, another project appears in the Project Explorer called acwztool. I can see forms and modules, but when I click on one of them, I get a "Project Locked" pop-up saying "Project is unviewable".


I tried adding a trusted location, I tried exporting all objects into a new Access database, and I tried some online suggestion of changing a value in a hex editor to unlock it. Nothing seems to work. I'm not sure what kinds of locks people can put on these databases. I'm never prompted for a password...it is just locked.


Access was and is often used as the database. But, the code and application may very well have been developed using c++, VB5, VB6, maybe even delphi (pascal). So, you might try to look at the .exe file with some kind of inspector. But, if that folder has a .exe file, then that means the application part was not written in ms-access, but in some other system - only the database looks to be access. So, even some commercial products like Simply accounting at one time used Access database, but the application was not written using access.


Maybe your lucky, and it was written in say vb.net (I say lucky, since there are a number of de-compilers - that would in theory create/generate the source code used to create the .exe. However, if this is not a .net .exe, then things become more difficult to de-compile.


ACCDB files are the default Microsoft Access database format in Access 2007 and later. The ACCDE format is a read-only, compressed version of an Access database that hides all the Visual Basic for Applications (VBA) source code. You can convert ACCDB files to ACCDE in Access 2007 and later, including databases in Access for Microsoft 365.


If other users run Microsoft Access on their computers, you can use network file sharing in Windows; right-click the file and click Give access to > Specific people. If recipients don't have Access installed, you can provide the ACCDE file along with the link to download the Access Runtime application, which allows users to run the file on their machines.


CAUTION: If you plan to create a custom application using the Microsoft Access Developer's Toolkit (ADT) for Windows 95 or the Microsoft Office 97 Developers Edition (ODE), you should not programmatically start the Microsoft Access. Since you cannot distribute the required library files with your application, any Visual Basic code that runs the wizards can fail in the run-time environment. You must have a single, licensed copy of Microsoft Access for Windows 95 or Microsoft Access 97 installed on your computer to run the Microsoft Access Wizards by using the methods described in this article.


MORE INFORMATION

In Microsoft Access 97, the procedures for running the Wizards are contained in the Wzmain80.mde and Wztool80.mde library databases, which are located in your Microsoft Office folder (for example, C:\Msoffice\Office).


In Microsoft Access 7.0 for Windows 95, the procedures for running the Wizards are contained in the Wzmain70.mda and Wztool70.mda library databases, which are located in your Microsoft Access folder (for example, C:\Msoffice\Msaccess).


When you call a procedure in a library database, the required syntax can vary, depending on if you have a reference to the library within your database.

Syntax with a Reference

If your database has a reference to Wztool80.mde and Wzmain80.mde (Microsoft Access 97) or Wztool70.mda and Wzmain70.mda (Microsoft Access 7.0), you can call the wizard procedures using standard syntax for running a function or subroutine. For example, to start a specific wizard from a form, you can copy the sample syntax below to the OnClick property of a command button on the form:


If you want to avoid creating a reference to Wztool80.mde and Wzmain80.mde (Microsoft Access 97) or Wztool70.mda and Wzmain70.mda (Microsoft Access 7.0), you can use the Run method of the Application object in a Visual Basic procedure to call a wizard, for example:


NOTE: In Microsoft Access 7.0 for Windows 95, you use the same syntax except you use a 7 instead of an 8 in the library name. For instance, the Attachment Wizard would be referred to as "Wztool70.att_Entry in Microsoft Access 7.0"


View products that this article applies to.

This article was previously published under Q115121

Moderate: Requires basic macro, coding, and interoperability skills.

You can start Microsoft Access Wizards from controls. This article describes how to start a wizard from a button on a form by calling the WLib_WizMain() function.


You can also start a wizard from a custom toolbar. To do so, see article Q113304 here in the Microsoft Knowledge base. In step 5 of that article, select Miscellaneous instead of Record Navigation, and then select Macro instead of Find Record. Then, use a macro with a RunCode action that runs the function WLib_wizmain("",0).


Retired KB ArticleRetired KB Content Disclaimer

This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.


Bereits seit der ersten Version ist Microsoft Access ist sehr erfolgreich im Markt fr Desktop-Datenbanken. Ein wesentlicher Faktor dieses Erfolges ist es, dass auch unerfahrene Anwender sehr schnell ein ansprechendes Ergebnis erzielen. Dabei wird der Anwender von Assistenten - so genannten Wizards - untersttzt.


Ein Teil der Funktionalitt der Oberflche von Access findet sich in den Dateien "utility.mda", "acwzdat.mdt", "acwzusr.mdt", "acwzlib.mde", "acwzmain.mde" und "acwztool.mde". Diese hat Microsoft zum Teil freigegeben so dass jeder, der sich dafr interessiert, anschauen kann, wie die Assistenten funktionieren.


Um das WizHook-Objekt sichtbar zu machen muss man die verborgenen Elemente anzeigen. Dazu klickt man mit der rechten Maustaste irgendwo, wo man keine Auswahl trifft. Aus dem Kontextmen whlt man "Verborgene Elemente anzeigen". Jetzt werden die versteckten Objekte eingeblendet. Ganz am Ende der Liste findet sich auch das WizHook-Objekt.


Beim Einsatz des WizHook-Objekts und seiner Funktionen ist zu beachten, dass das WizHook-Objekt nicht offiziell dokumentiert ist. Das bedeutet, dass es keine Untersttzung von Seiten von Microsoft gibt. Sie finden keine offizielle Dokumentation. Auch eine Hilfe zum WizHook-Objekt gibt es nicht. (Deshalb gibt es ja dieses Dokument ;-))


Aus dem Umstand, das Microsoft das WizHook-Objekt nicht dokumentiert hat, ergibt sich das Risiko, dass in einer zuknftigen Version die Eigenschaften und Methoden des Objekts gendert werden. Es kann auch passieren, dass eine Eigenschaft oder Methode nicht mehr implementiert ist. Der von Ihnen erstellte Code ist dann u. U. nicht mehr lauffhig oder muss ggfs. aufwndig angepasst werden.


Bei der Verwendung des Wizhook-Objekts ist Vorsicht geboten. Wenn Sie einen Parameter falsch bergeben kann es sein, dass Access komplett abstrzt. Auch dies ergibt sich aus der Tatsache, dass das WizHook-Objekt nicht dokumentiert ist. Die Funktionen sind nicht fr die Allgemeinheit implementiert worden. Vielmehr wird davon ausgegangen, dass der Programmierer wei, was er tut.


Trotz all dieser Risiken erscheinen manche Funktionen sehr reizvoll. Man muss sich dieser Risiken bei der Verwendung des WizHook-Objekts bewusst sein. Auf jeden Fall sollte man durch geeigneten Code sicherstellen, dass die bergebenen Parameter in den jeweiligen Gltigkeitsbereich passen.


Es haben schon viele Programmierer das WizHook-Objekt mit seinen Eigenschaften und Methoden im Objekt-Katalog entdeckt. Beim Einsatz wurde viele jedoch enttuscht. Die Funktionen des WizHook-Objekts schienen nicht zu funktionieren. Es passierte einfach nicht.


Der Schlssel zum WizHook-Objekt ist der Key. Damit wird das WizHook-Objekt aktiviert. Der Key muss whrend einer Access-Sitzung nur einmal eingegeben werden und schon stellt das WizHook-Objekt seine Eigenschaften und Methoden whrend der gesamten Laufzeit von Access zur Verfgung.


Ich persnlich bevorzuge den dritten Weg. Der Code wird dadurch klarer und verstndlicher. Der Key wird an der Stelle gesetzt, an der er bentigt wird. Auf das (berflssige) Zurcksetzen des Keys wird verzichtet.


Die bisherige Dokumentation zum Wizhook-Objekt basiert auf meinen Recherchen aus den Jahren 2005 und 2006. Im Herbst 2022 hat mich Colin Riddington angesprochen. Colin hat das Wizhook-Objekt fr sich entdeckt und ebenfalls auf seiner Webseite einen ausfhrlichen Artikel dazu bereitgestellt:




Wenn man mit dem Begriff "Wizhook" bei www.google.de eine Suche startet, dann findet man nur ca. 50 Treffer. (Stand 05/2005)

Die meisten Treffer verweisen auf Webseiten in asiatischer oder russischer Sprache. Andere Webseiten sind schlicht nicht mehr verfgbar.

Es finden sich auch einige Treffer in Forumsdiskussionen. Dabei geht es meistens darum, dass es das Wizhook-Objekt gibt. Inhaltliche Beschreibungen sind selten.

3a8082e126
Reply all
Reply to author
Forward
0 new messages