Solved

Automation Error, Unspecified Error when opening ado recordset

Posted on 2007-11-19
7
2,097 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

744 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

10 Experts available now in Live!

Get 1:1 Help Now