Error in SELECT clause: expression near '['

romdawg

New member
Joined
Jun 14, 2006
Messages
1
Programming Experience
Beginner
need help: whenever I drag a database table from server explorer to a WinForm (SQL server 2005 database), I get the following error:

The wizard detected the following problems when configuring the Data Adapter for "MyTableName".

Details:

Generated Select Statement.

Error in Select clause: expression near '['
Error in From clause: near '['
Unable to parse query text.


I found the following MS fix for this problem here: http://support.microsoft.com/kb/325790
However once I installed service pack 1 for visual studio .net 2002, I still got the same error. Anyone know why I'm still getting this error?
Thanks
 

YsT

New member
Joined
Jan 17, 2022
Messages
1
Programming Experience
10+
15 years later, same weirdness, here in a C# environment targeting M$Access :::
Connection String :::
Provider=Microsoft.ACE.OLEDB.16.0; Data Source=c:\Mnt\<etc.>\M$Access2016v16\WhWhWh2019.accdb
Select statement :::
SELECT item_id, [item~dhid], FK_Core_Item_Type, item_names_count, item_names_count_When, ID, item_type, SortKey FROM [q001 items & types]
TableAdapter Configuration Wizard says :::
The wizard detected the following problems when configuring the TableAdapter: "q001 items types":::
Details :::
Generated SELECT statement.
:::
Error in SELECT clause: expression near '['.
Missing FROM clause.
Error in FROM clause: near '['.
Unable to parse query text.

However, just pressing [[ Finish ]] on the Wizard, and subsequently "Preview Data" -> turns out to be successful.
 
Top Bottom