Why is the query that I made in access not working from my VB.NET app?

VS 2005

I am creating an application that pulls data out of an Access database file.  I am using the .NET OLEDB data provider to do this.  I created a fairly complex query using the designer in Access.  I then switched to the SQL view and cut and past the query into my application that I am developing.  I am getting errors in my application.  The queries are large so I've been testing pieces of them but getting inconclusive results.  Sometimes it looks like there might be key words in my query, other times it looks like the joins have syntax errors in them.

Is there a difference between the query syntax used in Access and the query syntax I should use from my app?


Who is Participating?
chinu1310Connect With a Mentor Commented:
Hi Todd,

Basically you have to take care of the brackets and single quotes etc stuff when you are writing your query in your application.

Can you post some query and some error so we can have more idea.
Todd_AndersonAuthor Commented:

Thanks for the suggestion.  You were right.  I added brackets around all table and field names and replaced # signs with ' around my dates and everything worked perfectly.

Glad to help you. :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.