[AccessD] ADP - Reset connection => Error?

Sad Der accessd666 at yahoo.com
Tue Apr 3 04:24:39 CDT 2007


Hi,

I need to reset the
CurrentProject.Connection.ConnectionString value for
my ADP (2002)

When I try:
CurrentProject.Connection.ConnectionString =
strConnString

I get the error:
Operation is not allowed when the object is open.

This is true because the following returns false:
?CurrentProject.Connection.State = adStateClosed 

So before setting the new connectstring property I try
to close the connection but none of the below seem to
work, although they do NOT return an error!
Application.CurrentProject.CloseConnection
CurrentProject.CloseConnection
CurrentProject.Connection.Close 
set CurrentProject.Connection = nothing (?? just
trying)

Goal: How can I set a new connect string?

Regards,
Sander
PS: I asked this before and got some good answers.
Throughout the app several functions are used that use
CurrentProject.Connection. These are called hundreds
of times!! I do not want to modify that code.


 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 



More information about the AccessD mailing list