| | | Forum Newbie
       
Group: Forum Members Last Login: 3/17/2005 3:30:00 PM Posts: 2, Visits: 1 |
| Hi all
I have an application with a data environment on that has a connection object with a load of commands which all works fine ,
However I want to close the connection in order to make a backup of the access database which I can do, but the problem is that when I reopen the connection and try and access data thru 1 off the command objects I get the 3709 error Operation not allowed on an object referencing a closed or invalid connection,
we have tried checking the connection state so we can take the appropriate acction depending on it's state but no good we have also tried changing the connection string but this doe's not seem to have any effect either, so at the moment we are up a gum tree
anybody any Ideas ?
any help would be welcome thanks
Chippy
|
| | | | Forum Member
       
Group: Forum Members Last Login: 4/21/2005 9:20:00 PM Posts: 76, Visits: 1 |
| Hai..
once you close the connection, you cannot open the database that's why you got error. You can do it this way after the query:
rs.Close Set rs = Nothing
Hope this helps..
regards
Tjhaine1100 |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 3/17/2005 3:30:00 PM Posts: 2, Visits: 1 |
| That Helps Many Thanks : Chippy |
| | | | Forum Member
       
Group: Forum Members Last Login: 4/21/2005 9:20:00 PM Posts: 76, Visits: 1 |
| Good thing i help
regards,
Tjhaine1100 |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 4/6/2005 5:46:00 AM Posts: 1, Visits: 1 |
| thank you very much I want to ask you. Should I must to close connection to My Database after closing every form (if I oprn database in this form) or not and if i Wrote rec.close rec.close set rec=nothing is enough to close connection to my database or not And what is best way to close connection to database bacause my program is still present in memory after closing the program Thank you very much Sorry for my bad English |
| | | | Forum Member
       
Group: Forum Members Last Login: 4/21/2005 9:20:00 PM Posts: 76, Visits: 1 |
| No need to close the db once the form is close. Just close the db every after query. e.g.
rs.open "Select * from Db" 'Code Here
rs.close
But dont forget to close the connection once the form is close e.g.
Private Sub cmd_Exit() cnn.close End Sub
Hope this helps..
regards, james
Tjhaine1100 |
| |
|
|