我们可以在udcx文件中包含where子句吗?

时间:2011-07-11 22:16:23

标签: sharepoint-2010 infopath

我有一个InfoPath表单,它有两个数据连接:

  1. 连接到SharePoint列表
  2. 连接到连接到SQL数据库并执行视图的udcx文件。该文件位于“数据连接库”中。
  3. 查询是这样的

    select "Ultipro id" as "Ultipro_id","Employee E" as "Employee_E","Anapharm id" as "Anapharm_id","First Name" as "First_Name","Last Name" as "Last_Name","User Name" as "User_Name","Company","CmpCompanyCode","EE Home Country" as "EE_Home_Country","Department Name" as "Department_Name","Department Code" as "Department_Code","Reporting Location" as "Reporting_Location","Rpt Location Code" as "Rpt_Location_Code","EecJobTitle","EecSupervisorID","1st Lvl Supervisor" as "_1st_Lvl_Supervisor","Executive Dept Head" as "Executive_Dept_Head","HR Rep" as "HR_Rep","EecEEtype","2nd Level Supv" as "_2nd_Level_Supv" from "dbo"."EmpDetail" as "EmpDetail"
    

    视图返回2195行,将来此数字可能会增加。

    有没有办法在此查询中包含where子句? where子句应在[User Name]列上过滤。在我的InfoPath表单中,我有一个人员选择器,它应该成为where子句的参数。

    有没有办法在没有自定义编码的情况下包含where子句?

1 个答案:

答案 0 :(得分:0)

我担心这是不可能的......我建议编写一个WebService,而不是通过udxc文件直接连接到SQL-Server。

您可以创建一个以UserName作为参数的操作,根据它查询数据库,并返回结果集。