以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何设置不加载数据  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=8920)

--  作者:lihe60
--  发布时间:2010/12/27 9:50:00
--  如何设置不加载数据

在BeforeLoadInnerTable属性中,如何设置加载某个表,不加载其他任何表的代码?


--  作者:lihe60
--  发布时间:2010/12/27 9:51:00
--  

If e.DataTableName = "用户管理" Then
    e.SelectString = "Select * From {用户管理}"
Else
    e.SelectString = "Select * From {" & e.DataTableName & "} where 单据类型=\'\'"
End If

这个代码有什么问题?


--  作者:狐狸爸爸
--  发布时间:2010/12/27 9:55:00
--  

请看看此事件的说明:

 

http://help.foxtable.com/topics/0669.htm

 

就会明白,该事件没有e参数SelectString,BeforeLoadOuterTable事件才有。

 

一个针对内部表,一个针对外部表,使用方法也有所差异。


--  作者:lihe60
--  发布时间:2010/12/27 12:43:00
--  

BeforeLoadOuterTable

If e.DataTableName = "用户管理" Then
    e.SelectString = "Select * From {用户管理}"
Else
    e.SelectString = ""
End If

运行代码有点问题,不知是为什么?错在哪里?

 


--  作者:lihe60
--  发布时间:2010/12/27 12:56:00
--  
我的目的是除了加载用户管理,在打开软件时不加载其他任何表
--  作者:狐狸爸爸
--  发布时间:2010/12/27 14:41:00
--  

如果是不加载数据,那么:
 
If e.DataTableName <> "用户管理" Then
     e.SelectString = "Select * From " & e.DataTableName & " Where [_Identify] Is Null"
 End If