runtime error '-2147467259 (80004005)'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tgit
    New Member
    • Nov 2007
    • 5

    runtime error '-2147467259 (80004005)'

    Hi,
    I have moved application from windows 2000 to xp platform. I am using Access 2003.

    I am getting the error during a insert operation on table.

    Error:
    runtime error '-2147467259)'
    ODBC connection to 'Employeesystem ' failed.

    Curious point is that delete operation on table is working fine.

    Any thoughts on how to resolve this error?

    Thanks
    TG
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Can you kindly post your code for reference of our experts.

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Hi,

      I'am not sure, but Check if this is the cause of Error:
      REad this

      Also Check the Error Source

      Regards
      Veena

      Comment

      • tgit
        New Member
        • Nov 2007
        • 5

        #4
        Hi,
        Code below:
        Code:
        Set conn = Application.CurrentProject.Connection
                    Set cmd = New ADODB.Command
                    cmd.ActiveConnection = conn
                    
                    strQuery = "INSERT INTO DETAILED_TRANSACTION ( TRANSACTION_ID, CARD_NUMBER, TRANSACTION_DATE, TRANSACTION_TIME, WHERE_NAME ) " & _
                               "SELECT [TxnID] AS TRANSACTION_ID, [CARDNUMBER] AS CARD_NUMBER, Format([DATETIMEOFTXN],'mm/dd/yyyy') AS TRANSACTION_DATE, " & _
                               "Format([DATETIMEOFTXN],'hh:mm:ss') AS TRANSACTION_TIME, [WHERENAME] AS WHERE_NAME FROM " & _
                               "ALARM_EVENT_TRANSACTION_TABLE WHERE Format(DATETIMEOFTXN,'mm/dd/yyyy') Between " & _
                               "'" & strStartDate & "' And '" & strEndDate & "' And CARDNUMBER <> 0; "
                              
                    cmd.CommandText = strQuery
                    cmd.Execute
        Error comes in cmd.Execute statement
        Last edited by tgit; Nov 21 '07, 07:49 AM. Reason: forgot to add comment

        Comment

        • QVeen72
          Recognized Expert Top Contributor
          • Oct 2006
          • 1445

          #5
          Hi,

          change your Where condition and check:

          " Between #" & strStartDate & "# And #" & strEndDate & "# "

          Regards
          Veena

          Comment

          • tgit
            New Member
            • Nov 2007
            • 5

            #6
            Thanks a lot for your reply Veena

            Could you let me know why '#' does work instead of upper quote ( ' )?

            Thanks
            TG

            Comment

            • tgit
              New Member
              • Nov 2007
              • 5

              #7
              Veena, Using '#' does not solve problem.


              Any other thoughts?

              Thanks,
              TG

              Comment

              • QVeen72
                Recognized Expert Top Contributor
                • Oct 2006
                • 1445

                #8
                Hi,

                Dates in Access should be Wrapped with #.
                Have you Checked Insert Query works in Access (backend)..?
                Did you check the links what i gave in my previous post...?

                Regards
                Veena

                Comment

                • tgit
                  New Member
                  • Nov 2007
                  • 5

                  #9
                  The issue was due to linked table. ODBC connection was required to be set again at new machine.

                  I did that and it worked just fine.

                  Thanks Veena for your help . And yes, upper quote ( ' ) works fine in query.

                  Regards,
                  TG

                  Comment

                  Working...