Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

.NET data adapter rewrites my queries :-(

I am accessing an Access 2.0 database using a .NET data adapter.

The SELECT query I use works perfectly inside Access. There is no problem with it - it just works.

However, when I enter it into the data adapter, no matter how I enter it, it converts it to another syntax, which uses INNER JOIN.

And then, it complains that the query's syntax is broken.

Why doesn't it pass the SQL string to the Access database engine, they way I write it? Why does it insist in converting it to another syntax?

Maybe Access 2.0 doesn't even know about "INNER JOIN".

Is there any way to solve this problem?

Monday, October 13, 2003

kindly post your database connectivity & query code for us to review.

Monday, October 13, 2003

Indeed... OleDbDataAdapter, OdbcDataAdapter or what? It should be the former BTW.

Duncan Smart
Saturday, October 18, 2003

I just thought -- don't use the graphical query designer then -- just copy and paste the Access SQL into the SQL textbox; you're using the DataAdapter Wizard aren't you? The graphical editor I think is really optimised (and primarily designed for) for SQL Server T-SQL -- so don't use it!

Duncan Smart
Saturday, October 18, 2003

The SQL you write internally to access and the SQL you use through OLEDB are not necessarily going to be identical - and its entirely possible that what works in one case will not work in the other.

There are various reasons for this, not least of which is that the stuff run through OLE DB is rather closer to the ANSI standard than that used directly in Access (this has caused me immense pain and suffering in the past).

That said, the query build *does* work with OLEDB and access so the problem is in the translation... we'd need to know more to help.

Monday, October 20, 2003

*  Recent Topics

*  Fog Creek Home