我正在使用c#winform软件,正在连接到本地MS Access数据库(.mdb)
使用的连接字符串为Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb
,这被认为是一个要求,Ace不是一个选择。
我正在尝试使用函数ConcatRelated
,但始终遇到错误:
System.Data.OleDb.OleDbException (0x80040E14): Undefined function 'ConcatRelated' in expression.
我的查询如下:
string carColumnsAndTable = "SELECT c.Id, cust.CustomerName as InsuredName, c.CarPlate as VehicleNo, c.CarMake as Make, c.CarModel as Model, c.CarYear as VehicleYear, c.CarCc as CC, c.CarChasisNumber as Chasis, c.CarEngineNumber as EngineNumber, "
+ "ConcatRelated('d.DebtorName', 'CarDebtor cd left join Debtor d on cd.DebtorId = d.Id', 'cd.CarId = ' & [c.Id]) as Debtor "
+ "FROM ((Car as c) left join Customer as cust on c.CustomerId = cust.Id) ";
功能设置如下图所示:
查询在ms访问中工作正常:
有人知道我应该怎么解决吗?