reset or drop database connection to the sql server and refresh links to the tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MBMSOFT
    New Member
    • Apr 2010
    • 18

    #16
    when i put line currentproject. openconnection in code 7 as you wrote
    I got err message 2467 the expression you entered refers to object that is closed or doesn't exists

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #17
      Do you have any open access objects during these events:
      Forms, tables, queries, reports, and are these objects still open when you try to refresh the connections?

      Comment

      • jimatqsi
        Moderator Top Contributor
        • Oct 2006
        • 1293

        #18
        It looks to me like your links are dependent on the IP address of and the IP address gets changed with each new connection. Can your network guy set you up with static IPs for this? Or, perhaps better yet, can you not use the name of the server to make your connection, instead of the IP address?

        I don't really understand why the router IP ever is useful for making your connection to the database. But I'm far from being a network guy.

        Jim

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #19
          jimatqsi
          It looks to me like your links are dependent on the IP address of and the IP
          MBMSOFT
          Only way i can relink is to change ip adress in conn.stringEg 192.124.0.2(1st ip- router server ip)
          Absolutly J,
          Missed that statement in MBMSOFT's post - never hardcoded an IP address in any of my code because one can't rely on them to stay static

          It doesn't however, explain why the Connections are being held up when the there's a hickup in the network. They should drop and become available again without neededing Access to be closed and re-opened.

          M:Please post your exact connection string. You can use "*" for the actual sensitive bits.

          I suspect now that J's pointed it out that you're using something like
          DRIVER={SQL Server};Server= ip;....
          when, as J noted:
          DRIVER={SQL Server};Server= servername;.... might be the better way.

          This article my trend to use DSNLess links: Using DSN-Less Connections It's an old MVPAccess link so be aware that it talks about ADO being the default... in ACC2003 DAO returned to being the default - that will make sense when you read the article.
          Last edited by zmbd; Sep 10 '14, 06:32 PM.

          Comment

          • MBMSOFT
            New Member
            • Apr 2010
            • 18

            #20
            not at all... just the code... i thought the same, that there might some object keep connection ... and just used only the code but again is the same

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #21
              not following your last post there M

              Comment

              • MBMSOFT
                New Member
                • Apr 2010
                • 18

                #22
                i have tried in the past to use server name instead of ip adress in conn string but not always was that successfully (sometimes it happened some confusen that server name was not recognized in the network) i'm trying now to use servername and i'll see

                Comment

                • jimatqsi
                  Moderator Top Contributor
                  • Oct 2006
                  • 1293

                  #23
                  I see that problem sometimes with remote desktop. There are some instances where I can connect to the target system with server name and other instances where I have to to use the IP Address.Recent experience indicates that if I have one connection made with the IP address (over a VPN) then additional remote desktop connections can be made with the server name.

                  Here's a somewhat dated page discussing configuration settings on a network connection to address this.


                  Jim

                  Comment

                  • MBMSOFT
                    New Member
                    • Apr 2010
                    • 18

                    #24
                    BTW
                    I discovered something.. it might guide us to somewhere
                    I wrote code which after reestablishing connection is trying refresh links every 30 seconds and i found out that that it succeed to refresh link after 20-25 times trying (aprox.700sec/11min) so it seems old connection has been kept that time

                    Comment

                    • zmbd
                      Recognized Expert Moderator Expert
                      • Mar 2012
                      • 5501

                      #25
                      actual connection info please

                      Comment

                      Working...