currentdb.execute odbc--call failed error #4134

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bfuchs
    New Member
    • Nov 2012
    • 7

    currentdb.execute odbc--call failed error #4134

    Ben,
    Hi,
    First of all, here are my work tools : I have an Access 2003 app that uses an SQL Server DataBase (i know it's weird). I am using Microsoft SQL Server Management Studio Express.
    I am now trying to execute a query from my app to insert some rows from 2 tables into another. My query works well when i use it rigth into SQL Server Management or when i create a new query in Access, but it don't work in my app... It gives me the "ODBC Call failed" error for an unkwown reason that i can't discover because my query works well in other situations...
    Last edited by bfuchs; Nov 28 '12, 03:07 AM. Reason: typo error
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    It's hard to say what's wrong without seeing the code.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      See if you get the same error if you do a simple SELECT query on the ODBC linked table only. This will indicate whether the issue is with the ODBC setup exclusively, or whether the actual query you were working on has any bearing on the issue.

      Comment

      • bfuchs
        New Member
        • Nov 2012
        • 7

        #4
        hi to all, thanks for your reply!
        the error is a timeout from the server
        its being stuck at the following line
        CurrentDb.Execu te sSql, dbSeeChanges
        again, nothing is wrong with the sql, as i copy it to a query it works fine, with no delay at all!

        Comment

        • ck9663
          Recognized Expert Specialist
          • Jun 2007
          • 2878

          #5
          How big is the returned result set? You might need to change you setting so it can handle the return of the data set.

          Good Luck!!!


          ~~ CK

          Comment

          • bfuchs
            New Member
            • Nov 2012
            • 7

            #6
            fyi- its an append query, in this case it has just one record to apply.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32633

              #7
              Ben, what happened when you tried the test I suggested in post #3?

              Comment

              • bfuchs
                New Member
                • Nov 2012
                • 7

                #8
                hi, when selecting opening etc its all fine, just going thru code that fails

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32633

                  #9
                  That's curious. Is that the exact and full error message you get?

                  It seems to imply the problem is with the ODBC connection, yet you confirmed that isn't the case by testing for it explicitly. Did the results come back immediately? How long did the test take to produce results if that's measurable?

                  Comment

                  • bfuchs
                    New Member
                    • Nov 2012
                    • 7

                    #10
                    it took few seconds in query, while in code it runs forever...
                    even when trying to run the query thru code it fails.

                    Comment

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32633

                      #11
                      Well Ben, we haven't seen your code yet (unfortunately. It has been requested). However, the test of the SELECT SQL I suggested should definitely be run in the same way as the other query you have the problems with, otherwise it's hardly a valid test. I'm disappointed that you didn't explain this after I had to prompt you for the results originally, but only thought to mention it after I prompted you again. I fail to see how your response could be considered accurate in the circumstances you've just described. I get the impression you can't really be bothered - and that's on your own problem.

                      Frankly, I'll be looking for an indication of a change in attitude if I'm to expend any more effort on your behalf.

                      Comment

                      • bfuchs
                        New Member
                        • Nov 2012
                        • 7

                        #12
                        Hi Neo, i appreciate you efforts to help me, and apologize for the misunderstandin gs.. its just that am in middle of converting a database and this is only one of the issues standing on my way..
                        to make a long story short, these 2 lines for example gives me that exact error :
                        Code:
                        CurrentDb.Execute "delete * from  PES where id = " & CLng(sID), dbSeeChanges
                        CurrentDb.Execute sSql, dbSeeChanges
                        Thanks
                        Last edited by NeoPa; Nov 29 '12, 01:17 PM. Reason: Added mandatory [CODE] tags.

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32633

                          #13
                          I appreciate your position Ben, but without your full involvement there is very little we can do to help (Unless someone happens to know about your particular problem from experience). What we can try to do is to work with you, but that relies on you doing the hands-on work. We can't test for you. We can't even ensure you do the tests properly. We can only offer suggestions for you to try.

                          In this case, your code is helpful, but as it's dealing with the execution of SQL commands, there is little we can tell without seeing the strings passed. Here's a pointer to how to deal with SQL problems generally - Before Posting (VBA or SQL) Code. Some of these you may appreciate already, but hopefully it explains why some of these disciplines are important and helps you to get help.

                          Again, I understand if you don't have the time available to pursue this properly, but I would suggest that it's not worth anyone's time and effort unless you do. I'll leave that thought with you.

                          Comment

                          • bfuchs
                            New Member
                            • Nov 2012
                            • 7

                            #14
                            Congratulations !! After few days digging into this issue, i finally found the problem, in reward for your time, will share with you my experience...

                            The code was placed on the before delete event of the form, since apparently access already sends a delete request for sql agent on this record, therefore querying this row was sort of blocked by that pending delete process...solut ion-just placed the code on the delete event and it works!

                            Thanks allot for your efforts.

                            Ben

                            Comment

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32633

                              #15
                              I'm not sure I managed to help much Ben. It seems the issue was a complex one, but not related to anything described in here by the sound of it. Hopefully, at least the position of having to stop and look at the problem from an outside perspective enabled you to see the problem. Not an easy one to discover certainly.

                              Comment

                              Working...