Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2328
  • Last Modified:

Automation Error, Unspecified Error when opening ado recordset

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
ecohouse
Asked:
ecohouse
1 Solution
 
MikeTooleCommented:
The SQL looks OK, can you post the rest of your ADO code?
0
 
ecohouseAuthor Commented:
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
 
SpeedFingolfCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ecohouseAuthor Commented:
I was able to solve this problem awhile ago on my own.  See my last comment.
0
 
Vee_ModCommented:
Closed, 100 points refunded.
Vee_Mod
Community Support Moderator
0
 
ecohouseAuthor Commented:
Thanks.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now