ADO connection.execute problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saddist
    New Member
    • Jul 2007
    • 40

    ADO connection.execute problem

    Hello,

    I have a problem with connection.exec ute statemant

    Code:
    Con.Execute("UPDATE table SET column = 'a'")
    It does compile, but does not complete. It 'hangs' on this command and does nothing. No error no result.

    Cheers,
    sad
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    What is the tablename and the column name.

    Comment

    • saddist
      New Member
      • Jul 2007
      • 40

      #3
      table name "table" column name "column".
      What's the difference?

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        Table is a Reserved Word..
        So why name a Table name as "Table"...?

        Regards
        Veena

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          Try avoiding the restricted key words for naming purpose.

          Comment

          • saddist
            New Member
            • Jul 2007
            • 40

            #6
            Ok so table name is "ttt" and column name is "ccc". Still this does not solve the problem.

            Comment

            • QVeen72
              Recognized Expert Top Contributor
              • Oct 2006
              • 1445

              #7
              Hi,

              This is Update Table syntax:

              "UPDATE Table MyTable SET MyColName = 'a' "

              Regards
              Veena

              Comment

              • debasisdas
                Recognized Expert Expert
                • Dec 2006
                • 8119

                #8
                Does your condition satisfies in the database ?

                Comment

                • saddist
                  New Member
                  • Jul 2007
                  • 40

                  #9
                  Originally posted by QVeen72
                  Hi,

                  This is Update Table syntax:

                  "UPDATE Table MyTable SET MyColName = 'a' "

                  Regards
                  Veena
                  ummm...no?

                  What do you mean by condition?

                  Comment

                  • VBWheaties
                    New Member
                    • Feb 2008
                    • 145

                    #10
                    Originally posted by saddist
                    Hello,

                    I have a problem with connection.exec ute statemant

                    Code:
                    Con.Execute("UPDATE table SET column = 'a'")
                    It does compile, but does not complete. It 'hangs' on this command and does nothing. No error no result.

                    Cheers,
                    sad
                    It compiles because your syntax is correct. It doesnt complete because of something wrong with the data source.
                    I usually see hangs when I use a Sql Server that does not exist or is not online.

                    Comment

                    • saddist
                      New Member
                      • Jul 2007
                      • 40

                      #11
                      Originally posted by VBWheaties
                      It compiles because your syntax is correct. It doesnt complete because of something wrong with the data source.
                      I usually see hangs when I use a Sql Server that does not exist or is not online.
                      Server exists and is online, becouse
                      Code:
                      Con.Execute("Select * from *")
                      works just fine.

                      Comment

                      • VBWheaties
                        New Member
                        • Feb 2008
                        • 145

                        #12
                        Originally posted by saddist
                        Server exists and is online, becouse
                        Code:
                        Con.Execute("Select * from *")
                        works just fine.
                        I've never seen SELECT * FROM * but i'm sure its got its merits somewhere.

                        For your Execute, you can pass in adAsyncExecute for your Execute option parameter and it will allow you to return immediately without waiting for the Update to complete.

                        Code:
                           con.Execute("Update Table Set Field = 'value'", adCmdText, adAsyncExecute)

                        Comment

                        • debasisdas
                          Recognized Expert Expert
                          • Dec 2006
                          • 8119

                          #13
                          Originally posted by saddist
                          ummm...no?

                          What do you mean by condition?
                          Does your update query execute successfully at the backend outside VB ?

                          Comment

                          Working...