请教一个奇怪的数据环境问题(所有分全押上)
代码如下:If DataEnvironment1.Connection1.State = 1 Then
DataEnvironment1.Connection1.Close
End If
DataEnvironment1.Connection1.Open
Sql = "SHAPE {"
Sql = Sql + " select t1.FInterID,t1.FBillNo,t1.FDate,t2.FNumber as 单据类型,t3.FNumber as 源单类型,t1.FSourceBillNO,case when t1.FDSHK =0 then '否' else '是' end as 代收款项 ,"
Sql = Sql + " t1.FDSAmount,t4.FNumber,t4.FName,t1.FMobile,t1.FAddress,t1.FNote,t5.FNumber as 优先等级,t6.FName as 制单,t7.FName as 审核"
Sql = Sql + " from t_project t1,t_submessage t2,t_submessage t3," + strFERPName + ".dbo.t_Organization t4,t_submessage t5,"
Sql = Sql + " t_login t6,t_login t7"
Sql = Sql + " Where t1.FItemClassID = t2.FInterID And t1.FSourceBillstyle = t3.FInterID And t1.FCustID = t4.FItemID And t1.FLevel = t5.FInterID"
Sql = Sql + " and t1.FAddUserID=t6.FItemID and t1.FCheckerID=t7.FItemID and t1.FInterID=" + Label1(0).Tag + "} AS Command1 APPEND ({select t1.FInterID,t1.FEntryID,t2.FNumber,t2.FName,t2.FModel,t3.FName as FDW,t1.FQty,t1.FBatchNo"
Sql = Sql + " from t_projectEntry t1," + strFERPName + ".dbo.t_icitem t2," + strFERPName + ".dbo.t_MeasureUnit t3"
Sql = Sql + " where t1.FItemID=t2.FItemID and t2.FUnitID=t3.FMeasureUnitID } AS Command2 RELATE 'FInterID' TO 'FInterID') AS Command2"
DataEnvironment1.Commands.Item(1).CommandText = Sql
DataEnvironment1.Command1
-----------------
问题来了,在执行到DataEnvironment1.Command1时,系统弹出“无法支持请求的属性”,重来没有出现过这样的事,啥情况?
--------------------编程问答-------------------- 补充一下,开发平台用VB6 sp5+SQL Server2000 --------------------编程问答-------------------- 你的数据环境设计中 Command1 是不是被更改为别的名称了? --------------------编程问答-------------------- 没有啊,刚刚我删除了原来的command1,再新建了一个COMMAND1,问题一样 --------------------编程问答-------------------- 要完整设计好 command1 才行—— CommandText 不能为空。 --------------------编程问答-------------------- 我已经设置好commandText了,还是一样的问题。另外,我重新建了新的报表,问题依旧 --------------------编程问答-------------------- 调试时取得完整的 sql,然后贴到设计的 CommandText 中试试。
我记得 SHAPE 语句是需要特定的 Provider 吧,也许你的 ConnectionString 没设对。
补充:VB , 数据库(包含打印,安装,报表)