Professional Web Applications Themes

Problem querying data from Access - ASP Database

Hi all, I am trying to pull information by query using a pretty long SQL (feeding it by ADOConnection.Execute). I get this error: 0x80004005 Unspecified error If I change that to a simple "SELECT * FROM table", it won't happen. I put it in view so that I can call the view instead of using the long SQL, but again, I failed. I tried "SELECT * FROM view_name", "view_name", "EXEC view_name" that I found in Google, I got another error: ADODB.Recordset (0x800A0CC1) Item cannot be found in the collection corresponding to the requested name or ordinal. From another Google site, ...

Sponsored Links
  1. #1

    Default Problem querying data from Access

    Hi all,

    I am trying to pull information by query using a pretty long SQL (feeding it
    by ADOConnection.Execute). I get this error:

    0x80004005
    Unspecified error

    If I change that to a simple "SELECT * FROM table", it won't happen.

    I put it in view so that I can call the view instead of using the long SQL,
    but again, I failed.
    I tried "SELECT * FROM view_name", "view_name", "EXEC view_name" that I
    found in Google, I got another error:
    ADODB.Recordset (0x800A0CC1)
    Item cannot be found in the collection corresponding to the requested name
    or ordinal.

    From another Google site, I tried what it have, using a Command Object:

    Set cmd = Server.CreateObject ("ADODB.Command")
    cmd.ActiveConnection = AdoConn
    cmd.CommandText = "view_" & astrPosition(i)
    Const adCmdStoredProc = &H0004
    cmd.CommandType = adCmdStoredProc
    Set Rs = cmd.Execute

    Still the same error.
    Any clues?

    Thanks!
    fix.
    --



    Sponsored Links
    fix Guest

  2. #2

    Default Re: Problem querying data from Access

    http://www.aspfaq.com/show.asp?id=2009

    fix wrote: 

    joker Guest

  3. #3

    Default Re: Problem querying data from Access

    fix wrote: 

    This probably means that you've used reserved keywords for one or more of
    your field names. Check out the list at
    http://www.aspfaq.com/show.asp?id=2080

    If you have used a reserved keyword, your best option is to change the name
    of the field.

    If, for some reason, that is not possible, then you will need to remember to
    surround that field name with brackets whenever you use it in a query called
    via ADO.
     

    Does the saved query work when you run it in Access?
     

    If it runs in Access, then it still sounds like a reserved keyword problem.
     

    What line? The Execute line? Or one of the lines following the Execute?
     

    You don't need this.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

  4. #4

    Default Re: Problem querying data from Access

    Hi
     

    This means you're trying to retrieve a field which doesnt exist

    Sam
    Samuel Guest

  5. #5

    Default Re: Problem querying data from Access

    Thanks for replying, but none of them seems to work for me.

    --

    "joker" <com>
    ???????:phx.gbl... [/ref]
    (feeding it [/ref]
    SQL, [/ref]
    name 
    >[/ref]


    fix Guest

  6. #6

    Default Re: Problem querying data from Access

    Oh sorry guys, the problem is solved.
    The problem comes from my eyes, they looked at the wrong line in the source
    code.


    fix Guest

Similar Threads

  1. Problem querying Access DB for records within a certaindate range.
    By liquidorb in forum Coldfusion Database Access
    Replies: 5
    Last Post: January 19th, 03:25 AM
  2. querying FileMaker data
    By keyman in forum Coldfusion Database Access
    Replies: 1
    Last Post: January 9th, 09:46 AM
  3. Querying two datasources (MS ACCESS)
    By RuBot in forum Coldfusion Database Access
    Replies: 8
    Last Post: August 11th, 05:06 PM
  4. querying FileMaker data
    By da cheat in forum Coldfusion Database Access
    Replies: 0
    Last Post: April 26th, 03:05 PM
  5. querying FileMaker data
    By da cheat in forum Coldfusion Database Access
    Replies: 1
    Last Post: April 14th, 10:36 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139