Access Referencing

J

John Schuler

This is my first post. Thanks for all the good information everyone.


I have a question about using unregistered custom DLLs inside Access. Is
this possible?



This all started in an effort to isolate the source code as I rolled the
solution out to the public. I wanted the system to be able to fix broken
references and make the appropriate updates using the sysCmd function. I
have tried compiling my access to an MDE and that works. However, a
complied MDE will not all allow sysCmd to fix and add references.
 
A

Allen Browne

John, as you found, you cannot programmatically fix the references in a
database that has broken references.

As soon as VBA realizes there is a broken reference you are shot. You can
delay that slightly by disambiguating all calls in your startup code, but
you can't really get further than shutting down gracefully.

michka has more information here:
How to guarantee that references will work in your applications
at:
http://www.trigeminal.com/usenet/usenet026.asp?1033
 
A

Albert D. Kallal

This is my first post. Thanks for all the good information everyone.


I have a question about using unregistered custom DLLs inside Access. Is
this possible?

Yes, it is possbile.
The soltion to the problem is to use the windows api "loadlibary".

If you use loadlibrary, then you don't have to "regiseter" the dll, and you
can simply place the .dll in the same directory as you mdb (or mde).

There is number of examples in vb6 on the web, but fewer exmaples in
ms-access.

Stehpans Lebans pdf maker uses the loadlibary, and so does my winzip
example.

You can download my winzip example here:

http://www.members.shaw.ca/AlbertKallal/zip/index.htm

Note how my code users the zip32.dll, but does not have a reference, or even
have to "register" the dll. The loadlbiary code simply checks in the same
directory...loads the dll..and at that point the dll can be used....

You can find Stephens example here, and it does the same thing:

http://www.lebans.com/reporttopdf.htm

So, using loadlibary eliminates the need to register the library (regsvr32),
and also eliminates the need for you to set a reference. Note that we are
not talking about "com" objects, and automation, but simply using a .dll
library.
 
J

John Schuler

I have another question:

My DLL works in Access when I register it. However, when Deregister it and
utilize the loadLib api, it does not recognize it.

Question: when I compile the DLL in vb6, is there anything special I need
to do?

thanks in advance.
John Schuler
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top