Page 1 of 1

Access Query error - Field names containing question marks

Posted: Tue 22 Nov 2011 15:50
by Brob
One of my customers has an Access database with table fields which contain question marks.
Yes I know what you're saying, who uses '?' in field names, customers of course !

When I try to run a uniquery containing these field names it gives and error and the query fails.

Using the same SQL with ADOQuery OleDb Driver, works perfect.

Go into MS Access and query the table, also works perfect.

Any idea what's causing this ?

Thanks !

Posted: Thu 24 Nov 2011 09:14
by Brob
I realised after I posted this that Unidac uses ODBC driver for Access which seems to be the cause.

I'm not surprised, in my 25 years of programming I have never found any ODBC driver to be reliable for any database. Always use Oledb if possible, much better !

Do Devart have any plans to add Oledb as a Unidac provider ?

Posted: Thu 24 Nov 2011 13:29
by AlexP
Hello,

I checked UniDAC behaviour when working with MS Access tables that have the '?' symbol in their names and did not encounter any errors – tables are opened successfully, and data and field names are displayed correctly.
Please send us the database file to alexp*devart*com and specify versions of your UniDAC and IDE.

Posted: Thu 24 Nov 2011 14:15
by Brob
Hi Alex

I have sent a small sample to you

For more info

This works OK
SELECT * FROM Table1

This fails when you include the field name in the SQL

SELECT Table1.Fld1,
Table1.Fld2,
Table1.[Fld ?]
FROM Table1

This also fails with the same error
SELECT *
FROM Table1
WHERE
(Table1.[Fld ?] = '01')

Thanks

Posted: Thu 24 Nov 2011 15:45
by Brob
Meant to say the error is

[Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect

Posted: Fri 25 Nov 2011 14:13
by AlexP
Hello,

Thank you for the information. We have reproduced the problem, however, this problem is conditioned by the specifics of the ODBC driver and this behavior can only be changed on the level of the ODBC driver.

P.S. We shall consider a possibility of implementing the OLE DB support in our products in future.