Reference a VB 6.0 DLL, causes Access not to be able to close

C

Chris

I reference a DLL that was developed in VB 6.0 in MSAccess program &
Excel add-in.

When I close my Excel add-in, Excel closes without any problem.
When I close my Access program, Access does not closes. The program
closes, but Access remains open and I need to manually end the process
of MSACCESS.EXE.

I use the statements below for declaring and using the DLL.

Public DL As New MyDLL.DLV

DL.process_data

Set DL = Nothing

I erase any arrays I use in VB, for clearing the memory. How can I
solve this problem ?

Thanks a lot in advance!
 
A

ARC

Is this Access 97 I take it?

I remember having this problem for a database at a company I used to work
for. I'm trying to remember, but it seems to me that it had something to do
with no closing databases.

For example, if you did a:

Set db = currentdb()
set qdef = ....
set rs = qdef.openrecordset.....


Then if you had too many occurences of not having the qdef.close, rs.close,
db.close lines at the end of the proc, then this would cause the problem. I
hope I'm remembering correctly, but it seemed when we went through the code,
and made sure we closed out all db's, the problem went away.
 
C

Chris

Thanks for your message.

I am developing this in Access 2000.

I tried to close (set to nothing) all recordsets & databases before
setting the variable of DL to nothing.

Shall I do sth with the class in VB 6.0 ?

My class includes functions I am calling in both programs.
 
C

Chris

I found 2 solutions for my problem. Import all objects of my MDB into
another one, or remove the reference to the VB 6.0 DLL and add it
again. This was the easiest! :)
 
C

Chris

I noticed sth else also, reference to VB6.0 DLL should be removed and
added again, every time you create the DLL.
 

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