Lost ODBC Connection

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

In one of the modules I run I set a ODBC connection and
attach to my server. When I execute the module the
statements run then when it comes time to execute the
calls it tells me I have no ODBC connection to my server.
It only seems to happen in one module. The other module
that establishes an ODBC connection executes with no
problem. I have checked the spelling, syntax, and even
copied my functioning module connection string over but
it still fails. Any thoughts? My only guess is the
connection that works doesn't really use the connection
as it just clears a linked table.
 
Try putting a break at the start of each function, then
step through the code line by line. Also, I know that if
you have variables set and you have some sort of error
occur in the code, you lose the variables. This may be
happening here. One more thing. At the top of each
function put in the following line just under the function
header:

On Error goto 0

This will provide you with a system error message box and
allow you to debug.

Hope that helps!

Kevin
 
Back
Top