ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Crazy problem when using a WHERE-clause in a SQL query (https://www.excelbanter.com/excel-programming/305285-crazy-problem-when-using-where-clause-sql-query.html)

kuhni

Crazy problem when using a WHERE-clause in a SQL query
 
Hello everybody,

I am really having a very strange problem with my SQL query from Excel
VBA: If I make basic SQL queries to MS Access like SELECT * FROM xyz,
everything works fine.
But when I dynamically include a WHERE-clause I get an "General ODBC
problem" error message. Of course, I checked the statement and tested
the sql query directly in MS Access without any problems, so I am sure
that the sql statement is correct.
First I thought it is because my SQL-string was greater than 255
characters but I already solved this problem but the other one still
remains.

If anybody has an idea, I would be so grateful!


THANKS in advance,

Best wishes,
Stephan

Jamie Collins

Crazy problem when using a WHERE-clause in a SQL query
 
(kuhni) wrote ...

I am really having a very strange problem with my SQL query from Excel
VBA: If I make basic SQL queries to MS Access like SELECT * FROM xyz,
everything works fine.
But when I dynamically include a WHERE-clause I get an "General ODBC
problem" error message. Of course, I checked the statement and tested
the sql query directly in MS Access without any problems, so I am sure
that the sql statement is correct.
First I thought it is because my SQL-string was greater than 255
characters but I already solved this problem but the other one still
remains.


I think you will need to at least post your VBA code and preferably
your table schema and test data.

Jamie.

--


All times are GMT +1. The time now is 05:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com