Access Query error - Field names containing question marks

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Brob
Posts: 44
Joined: Mon 24 Oct 2011 07:31

Access Query error - Field names containing question marks

Post by Brob » Tue 22 Nov 2011 15:50

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 !

Brob
Posts: 44
Joined: Mon 24 Oct 2011 07:31

Post by Brob » Thu 24 Nov 2011 09:14

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 ?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 24 Nov 2011 13:29

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.

Brob
Posts: 44
Joined: Mon 24 Oct 2011 07:31

Post by Brob » Thu 24 Nov 2011 14:15

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

Brob
Posts: 44
Joined: Mon 24 Oct 2011 07:31

Post by Brob » Thu 24 Nov 2011 15:45

Meant to say the error is

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 25 Nov 2011 14:13

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.

Post Reply