+ Reply to Thread
Results 1 to 13 of 13

Run-time error '-2147467259(80004005)'

  1. #1
    Forum Contributor
    Join Date
    04-05-2011
    Location
    behind you!
    MS-Off Ver
    Excel 2010
    Posts
    116

    Run-time error '-2147467259(80004005)'

    Hi,

    I wrote this function to read some data from an access database:

    Please Login or Register  to view this content.
    I like to read a db table, called Modelle, with this attributes: Index, ModelName, Datum, Signal, Performance.

    Here I read the db:

    Please Login or Register  to view this content.
    The code throws this error:

    Run-time error '-2147467259(80004005)':

    Automation error
    Unspecified error


    By using the other sql command, that reads the whole table, there is no problem.

    Does anybody know, what might be the reason?

    Thank you very much!
    Lloyd

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run-time error '-2147467259(80004005)'

    Lloyd

    Does the SQL work when you try it manually in Access?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    04-05-2011
    Location
    behind you!
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Run-time error '-2147467259(80004005)'

    No!

    It throws this error:


    Compile error:

    Expected: Case

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Lloyd

    Access wouldn't give you a compile error for an SQL statement.

    What exactly did you try in ACCESS?

  5. #5
    Forum Contributor
    Join Date
    04-05-2011
    Location
    behind you!
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Run-time error '-2147467259(80004005)'

    I ran the sql command in the access vba editor Immediate window.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run-time error '-2147467259(80004005)'

    You can't run SQL commands directly in the VBEditor. You'd need to enter the SQL into a query.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run-time error '-2147467259(80004005)'

    It's an SQL query, not VBA.

    Open the database you are trying to work with, create a new query, don't add any tables,
    goto View>SQL..., paste the contents of the string SQL in that window and then click ! to run the query.

  8. #8
    Forum Contributor
    Join Date
    04-05-2011
    Location
    behind you!
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Run-time error '-2147467259(80004005)'

    OK, I did that.

    Now there is a new error:


    Reserved error (-3025); there is no message for this error

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run-time error '-2147467259(80004005)'

    I don't recognise that error - I'll check it out, but I'm pretty sure it's connected to the SQL query no being right.

    What is the SQL mean to do?

    Does it's constituent parts work on their own?

  10. #10
    Forum Contributor
    Join Date
    04-05-2011
    Location
    behind you!
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Run-time error '-2147467259(80004005)'

    OK, I did that.

    Now there is a new error:


    Reserved error (-3025); there is no message for this error

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Lloyd

    About all I can find about the error is that it means the SQL isn't valid.

    One quite common reason appeared to be that people were trying you use SQL from some other database and the syntax wasn't recognised by Access.

  12. #12
    Forum Contributor
    Join Date
    04-05-2011
    Location
    behind you!
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Run-time error '-2147467259(80004005)'

    Hmm..., I did not know that there are different database schemata for sql.
    I thought all distributors use "standard" sql.

    OK, so I will calculate the Median via vba excel, instad doing it inline sql.

    Thank you very much, Norie!

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    There are quite a few different 'flavours' of SQL.

    You can probably calculate the median in Access, if that's what you are trying to do, not sure how though.

    Mind you Excel is better suited for that sort of thing.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1