Active Query Builder support area

OleDB Command Question

Avatar
  • updated
  • Completed

Hi:

Version:Professional ASP.NET Edition 2.11.1 (released at 15 Apr 2016)

I use Excel file to query but table name no '[' & ']' in query string , I using command will error.

How to do, let table have '[ ]' Coated? Thanks.


Correct query string:

select * from [ 工作表1$ ]

Avatar
Andrey Zavyalov, PM

Yes. We developed special syntax providers for different SQL engines that support different SQL syntax and metadata extraction rules. It's a good idea to use them rather than uncertain generic syntax. MS Jet is a common SQL engine that is used to work with MS Access, Excel and Text/CSV files. MSAccessSyntaxProvider suits for all of these data sources.

Avatar
Shang

Hello,

I tried to use MSAccessSyntaxProvider for OLE DB connection to Excel is ok.

Thanks very much.

Avatar
Shang

Hi:

I use c# code information:

GenericSyntaxProvider syntaxProviderGeneric = new GenericSyntaxProvider();

queryBuilder.SyntaxProvider = syntaxProviderGeneric;
queryBuilder.MetadataProvider = new OLEDBMetadataProvider { Connection = connection };

So I must to use MSAccessSyntaxProvider for OLE DB & MS Jet ?

Avatar
Andrey Zavyalov, PM

Hello,

What syntax provider do your use? I recommend to use MSAccessSyntaxProvider for OLE DB & MS Jet connection to Excel.