Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Classic Visual Basic (VB 6 or earlier) » Database Programming » Access Database error 3709 heeeeeeeelp


Access Database error 3709 heeeeeeeelpExpand / Collapse
Author
Message
Posted 3/11/2005 11:27:33 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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



Post #9396
Posted 3/16/2005 9:34:01 PM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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
Post #9595
Posted 3/17/2005 11:21:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/17/2005 3:30:00 PM
Posts: 2, Visits: 1
That Helps
Many Thanks
: Chippy
Post #9625
Posted 3/29/2005 12:10:24 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 4/21/2005 9:20:00 PM
Posts: 76, Visits: 1
Good thing i help

regards,

Tjhaine1100
Post #10024
Posted 4/6/2005 8:31:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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

Post #10332
Posted 4/7/2005 9:31:06 PM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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
Post #10377
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin, Mod, Mark, Keithuk

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 3:51am