"SQL Time-Out Connection" error opening a from that has qselContract control source

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • syedshaffee
    New Member
    • Jan 2012
    • 91

    "SQL Time-Out Connection" error opening a from that has qselContract control source

    I'm , getting an error "Sql time out Conntection" while opening a from that has qselContract as control source.

    But when i run the query it works fine but when i open the form i get and error

    Please help on the same Given below is an attached doc with print preview
    Last edited by zmbd; Oct 26 '12, 11:30 AM. Reason: Please Use CODE tags for formating submitted code only.
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    I see no attached document.

    You need to provide some context here. What backend is being used, how is the form opened (code/manually), is any code fired in the open event, or just prior to form opening?

    Comment

    • syedshaffee
      New Member
      • Jan 2012
      • 91

      #3
      the Back end is sql sever 2005 And their is a procedure
      Code:
      Sub RecalcFunderAmounts()
      
          On Error GoTo Err_RecalcFunderAmounts
      
          If Not Nz(Me.txtCustomerID, 0) = 0 Then
              DoCmd.SetWarnings False
              DoCmd.OpenQuery "qdelztFunderFacility"
              DoCmd.OpenQuery "qappFunderFacility"
              DoCmd.SetWarnings True
              Me.frmCustomerSubFunder.Requery
          End If
      
          Exit Sub
      and i m getting an error in this Procedure and this is not called Any where in the events... I checked and the form is programmaticall y opened
      Attached Files

      Comment

      • TheSmileyCoder
        Recognized Expert Moderator Top Contributor
        • Dec 2009
        • 2322

        #4
        I am a bit confused. You say you get the error when you open a form, yet the code provided shows no form being opened.

        Which line is giving the error?

        Why do you open those queries? Are they action queries? If so, I would suggest using:
        Code:
        CurrentDB.Execute "qdelztFunderFacility"
        instead.

        Comment

        • syedshaffee
          New Member
          • Jan 2012
          • 91

          #5
          Ok let me try doing it with sql and it take more than 30 minutes and counting. i'm thinking of increasing the ODBC time out property in the query design view.. will it help this only gives me an error for a specific Clients(Filter criteria)

          thanx for your reply

          Comment

          • syedshaffee
            New Member
            • Jan 2012
            • 91

            #6
            YESSS! Problem solved i just increased the ODBC time out property in the queries design view thanx again TheSmileyCoder
            for your reply

            Comment

            • TheSmileyCoder
              Recognized Expert Moderator Top Contributor
              • Dec 2009
              • 2322

              #7
              You are welcome.

              Are you saying your query takes more then 30 mins to run?

              Comment

              • syedshaffee
                New Member
                • Jan 2012
                • 91

                #8
                Yes when i ran it at ssms

                Comment

                • TheSmileyCoder
                  Recognized Expert Moderator Top Contributor
                  • Dec 2009
                  • 2322

                  #9
                  Now of course I don't know your data or how much there is of it, but it sounds like a lot. I guess since you wrote you ran it ssms that the 30 mins are running directly on the server, and not having the access jet engine doing it.

                  Just my 2 cents.

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    Either you have a ton of data and a complex query (ie millions of rows joined to millions of rows joined to millions of rows) or your query is extremely inefficient.

                    Rather than suffer the 30 minutes, you should try to get it to run quicker instead.

                    Comment

                    Working...