B
BruceS
(Running Access 2003 SP3 on WinXP Pro.)
OK, this one is driving me nuts.
I have a module created by a 3rd party vendor (ZipInfo) which calls
functions from a DLL they provide. It has worked flawlessly for over 6 years
in 4 other .mdbs.
I copied that module into a new front end mdb and added code to call one of
the functions in a form module. Now, whenever any of the DLL functions are
called from my code, Access crashes completely. No normal error that I can
trap. Just a bunch of reports back to MS.
I have stepped through every line of code looking for a problem. Nada. I
have verified the values being passed to the functions. They are OK. This
..mdb is not any larger megabytes-wize than the working ones. It's a
front-end mdb, but at this point there has not been any connections
established to other databases.
The strange part is that, if I put a break just before the DLL function call
and type the next command into the Immediate Window, it works fine. In fact,
all of the DLL functions and subs work perfectly in that manner. They only
fail when called by running code.
I have done everything Allen Browne suggests for many problems: Name
auto-correct is turned off. Only references that are absolutely needed are
loaded. I have copied everything into a new .mdb. I have decompiled and
recompiled.
I've spoken with the vendor, and they are at a loss. It's obviously not
their code because it works manually. Plus, the other applications that use
that DLL are still working great.
Here is the pertinent code:
(From the form.)
'Coding fields have been loaded. See if coding is available.
If OpenAddrDLL() = 0 Then GoTo ReloadAddress
myResult = CheckAddress(myBusiness, myURB, myAddr, myCSZ)
(From the DLL module Declarations.)
Private Declare Function UNZ_CHECKADDRESS Lib "UNZDLL32.DLL" (ByVal hUnz As
Long, ByVal Line1$, ByVal Line2$, ByVal Line3$, ByVal Line4$) As Long
....
' ** NOTE Variable Names Are being duplicated from documentation.
Public hUnz As Long 'This is the handle for the DLL.
....
(My function from the DLL module. Been used a long time.)
Public Function CheckAddress(Line1 As String, Line2 As String, Line3 As
String, Line4 As String) As String
CheckAddress = ""
' Call the DLL to check the address and get the result code
(Crashes if next line is run.)
Result = UNZ_CHECKADDRESS(hUnz, Line1, Line2, Line3, Line4)
CheckAddress = Str(Result) & "|"
....
Does anyone have any suggestions on how to track down and correct the
problem?
Thanks,
Bruce
OK, this one is driving me nuts.
I have a module created by a 3rd party vendor (ZipInfo) which calls
functions from a DLL they provide. It has worked flawlessly for over 6 years
in 4 other .mdbs.
I copied that module into a new front end mdb and added code to call one of
the functions in a form module. Now, whenever any of the DLL functions are
called from my code, Access crashes completely. No normal error that I can
trap. Just a bunch of reports back to MS.
I have stepped through every line of code looking for a problem. Nada. I
have verified the values being passed to the functions. They are OK. This
..mdb is not any larger megabytes-wize than the working ones. It's a
front-end mdb, but at this point there has not been any connections
established to other databases.
The strange part is that, if I put a break just before the DLL function call
and type the next command into the Immediate Window, it works fine. In fact,
all of the DLL functions and subs work perfectly in that manner. They only
fail when called by running code.
I have done everything Allen Browne suggests for many problems: Name
auto-correct is turned off. Only references that are absolutely needed are
loaded. I have copied everything into a new .mdb. I have decompiled and
recompiled.
I've spoken with the vendor, and they are at a loss. It's obviously not
their code because it works manually. Plus, the other applications that use
that DLL are still working great.
Here is the pertinent code:
(From the form.)
'Coding fields have been loaded. See if coding is available.
If OpenAddrDLL() = 0 Then GoTo ReloadAddress
myResult = CheckAddress(myBusiness, myURB, myAddr, myCSZ)
(From the DLL module Declarations.)
Private Declare Function UNZ_CHECKADDRESS Lib "UNZDLL32.DLL" (ByVal hUnz As
Long, ByVal Line1$, ByVal Line2$, ByVal Line3$, ByVal Line4$) As Long
....
' ** NOTE Variable Names Are being duplicated from documentation.
Public hUnz As Long 'This is the handle for the DLL.
....
(My function from the DLL module. Been used a long time.)
Public Function CheckAddress(Line1 As String, Line2 As String, Line3 As
String, Line4 As String) As String
CheckAddress = ""
' Call the DLL to check the address and get the result code
(Crashes if next line is run.)
Result = UNZ_CHECKADDRESS(hUnz, Line1, Line2, Line3, Line4)
CheckAddress = Str(Result) & "|"
....
Does anyone have any suggestions on how to track down and correct the
problem?
Thanks,
Bruce