+ Reply to Thread
Results 1 to 3 of 3

Excel ADO-Bad Field in Access

  1. #1
    Al
    Guest

    Excel ADO-Bad Field in Access

    I'm using ADO within Excel to update an Access table and query off it.

    The field Zone either has a value of 0 (zero) or P.

    However, when I try to include this field in a query or in the where clause
    of my SQL statement, I get the error message:

    "Method Open of Object Recordset failed"

    I've tried making the value text by using the excel text function and then
    uploading the value but this hasn't worked.

    Would appreciate any feedback.

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    10-25-2004
    Posts
    88
    did you enclose the values 0 and P in single quotes within double quoted SQL statement?

    The WHERE clause should look like:

    "WHERE (( " & Zone & " = '0')+( " & Zone & " = 'P'"))"

    The double quotes must probably be adjusted to take your exact SQL statement into acount, but you should get the idea.
    To be honest the " and ' business is a real mess.

  3. #3
    Robin Hammond
    Guest

    Re: Excel ADO-Bad Field in Access

    Al,

    Can you post your SQL query or offending code, and perhaps the table
    definition.

    Robin Hammond
    www.enhanceddatasystems.com

    "Al" <Al@discussions.microsoft.com> wrote in message
    news:6F2D53BD-7086-4D83-BEE5-E5A8DBEEE470@microsoft.com...
    > I'm using ADO within Excel to update an Access table and query off it.
    >
    > The field Zone either has a value of 0 (zero) or P.
    >
    > However, when I try to include this field in a query or in the where
    > clause
    > of my SQL statement, I get the error message:
    >
    > "Method Open of Object Recordset failed"
    >
    > I've tried making the value text by using the excel text function and then
    > uploading the value but this hasn't worked.
    >
    > Would appreciate any feedback.
    >
    > Thanks in advance.




+ 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