Solved

Automation Error, Unspecified Error when opening ado recordset

Posted on 2007-11-19
7
2,110 Views
Last Modified: 2010-05-18
I'm running a query and get the error in the subject line above.  This
is the query:

strSQL = "SELECT XL_Import.Gate, XL_Import.Region, XL_Import.Section,
XL_Import.[Charter Fields], " & _
         "XL_Import.[Data Value], XL_Import.[Matrix 1 Table],
XL_Import.[Matrix 1 Attribute] " & _
         "FROM XL_Import " & _
         "WHERE (XL_Import.Section = 'DF" & x & "') AND (XL_Import.
[Data Value]<>'0') AND " & _
         "(XL_Import.[Matrix 1 Table]= 'ProductOption') AND (XL_Import.
[Matrix 1 Attribute]     ='package direction');"


If I paste this into an accesss query it runs fine.  Any ideas what is
going on?  I'm using Access 2003.


0
Comment
Question by:ecohouse
7 Comments
 
LVL 27

Expert Comment

by:MikeToole
ID: 20314414
The SQL looks OK, can you post the rest of your ADO code?
0
 

Accepted Solution

by:
ecohouse earned 0 total points
ID: 20314643
Thanks for the quick response.   I was able to figure out the problem.
It turns out that in this line:
(XL_Import.Section
I needed to put brackets around the word section.  to make it look like this:
(XL_Import.[Section]

I didn't know that Section was a keyword.  And because the query was running I didn't think that was the problem.  And the ambiguous Access error message didn't help either.
0
 
LVL 3

Expert Comment

by:SpeedFingolf
ID: 20508528
The error message is not ambiguous at all. The problem is the automation error is that the ADO recordset can not be created, since the SQL sentence that should be used to build and popullate it IS NOT A VALID SQL sentence and therefore, can not be parsed to get a result, which would be the recordset.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:ecohouse
ID: 20567773
I was able to solve this problem awhile ago on my own.  See my last comment.
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20631439
Closed, 100 points refunded.
Vee_Mod
Community Support Moderator
0
 

Author Comment

by:ecohouse
ID: 20641676
Thanks.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now