[AccessD] ADP - Reset connection => Error? SOLVED

Sad Der accessd666 at yahoo.com
Tue Apr 3 07:10:30 CDT 2007


Gustav,

You're idea works...only 1.000.000 changes to go ;-)
Maybe a bit exadurated...

Regards,

Sander

--- Sad Der <accessd666 at yahoo.com> wrote:

> I need this because we need to set/check the
> databaseconnection from outside the database e.g. an
> ini file.
> 
> If it isn't possible to reset the connection to
> another sql server, than we've got a problem....
> 
> As I said before. Throughout the code the
> CurrentProject.Connection is used to set the
> connectstring. I feel a Find/Replace comming on...
> Not
> something I would like to do because I have to test
> all changes. 
> 
> Sander
> PS: There are few changes (1-3) on the database per
> day but these can have major financial conseq. E.g.
> values below €100.000 are neglected!!
> 
> --- Gustav Brock <Gustav at cactus.dk> wrote:
> 
> > Hi Sander
> > 
> > I don't think you can cut the connection belonging
> > to CurrentProject ... that would be like kicking
> > your own feet away.
> > I guess you need to create a new Connection object
> > and then use that for whatever your purpose is.
> > 
> > /gustav
> > 
> > >>> accessd666 at yahoo.com 03-04-2007 11:24:39 >>>
> > 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.
> > 
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> >
> http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > 
> 
> 
> 
>  
>
____________________________________________________________________________________
> Sucker-punch spam with award-winning protection. 
> Try the free Yahoo! Mail Beta.
>
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



 
____________________________________________________________________________________
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