介绍SharePoint在线访问服务查询以供外部使用
-
10-12-2019 - |
题
是否有任何方法可以在SharePoint Online的Access Services中为Access Services编写查询,并通过Web服务或用于.NET的客户端对象模型曲面曲面就像表一样浮出水面的方式?
背景
我们有一个访问数据库,它使用用于在线的Access Services浮出来。 我已经获得了从访问服务中检索某些数据作为XML文件的任务,以进入另一个系统。
有一个现有的查询,用SQL编写了在此数据(从Access数据库在线前的时间)非常复杂,我担心如果我将其转换为CamlQuery或使用LINQ创建查询,则担心那1)它不会拥有SQL中存在的所有功能,而且2)它将变成臃肿,使运行缓慢并难以维护。
简化示例查询:
select *
from members m, info i
where m.id = i.memberid
and year(m.date) = 1900
UNION
select *
from members m
where m.id not in (select memberid from info)
UNION
select *
from members m, info i
where m.id = i.memberid
and i.date_to = (select max(date_to) from info where memberid = i.memberid)
Order By m.Name
. 解决方案
I ended up doing this by using the C# client object model to import all the data from the relevant lists into an in-memory SQLite database, and then running a modified SQL query on the SQLite tables. As there wasn't that much data this was an acceptable method.