"Error 49: Bad DLL Calling Convention"

P

(PeteCresswell)

MS Access has started throwing this error at the exit point of
one of my routines.

/Decompile followed with a compact/repair makes it go away; but
what's got me worried is that it's come back twice over the past
weeks - for total of 3 appearances.

I also am pretty sure I've been through this a couple of times in
years past.

Googling, most of what I see is in the spirit of Jeffery
MacLeod's post to microsoft.public.access.modulesdaovba in the "
Possible answer to Err 49: Bad DLL calling convention" thread:
---------------------------------------------------------
The error you are receiving error # 49: "Bad DLL calling
convention" is often caused by incorrectly omitting or including
the ByVal keyword from the Declare statement. This error can also
be caused if the wrong parameters are passed.
----------------------------------------------------------

That's fine, and I'll be extra careful to make sure I don't
default any of my passed parms to ByRef... but what's got my
attention is that it happens, then goes away with the
compact/repair and doesn't happen on the next test using the same
data.

Anybody have any further insights?

My main concern is that the application is somehow subtly
corrupted and that the other shoe is going to fall eventually.

OTOH, maybe I'm lying about the test data being the same and it's
tripping over a Null or something....
 
D

David W. Fenton

My main concern is that the application is somehow subtly
corrupted and that the other shoe is going to fall eventually.

Well, you can recreate the whole project with
Application.SaveAsText, .LoadFromText and there will be no
corruption carried along, as there can be with decompiling and
importing.
OTOH, maybe I'm lying about the test data being the same and it's
tripping over a Null or something....

Are there any references to external libraries? Have you checked all
usage of those libraries? If not, then it sounds like the libraries
involved are internal to Access, and you've got no control over
that. In that case, I'd vote for project corruption.
 
J

Jeanette Cunningham

Hi,
I had this problem recently. I had done something silly with my coding so
that the function was confused about whether a value was true or false.
So my advice is to fine the sub or function where this error appears and
correct any logical errors in the routine.

Jeanette Cunningham
 
S

splansing

Is this all relatively recent stuff? Because I've encountered a
situation where a hotfix has disrupted things subtly and caused errors
like this. I've got the same situation going, and I can trace the
code step by step all the way through the function, and it appears to
be fine...but then crashes when it exits. Furthermore, this function
has been working unchanged for a lot of months now. It does return a
boolean value, and I will check that out...although at the Exit
Function statement it appears to know very clearly what it should be
returning... I suspect some sort of Access bug, but we'll see.
 

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