以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何锁定所有的外部表?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=82454)

--  作者:sloyy
--  发布时间:2016/3/17 23:20:00
--  如何锁定所有的外部表?
我用了以下办法,想只锁定所有的外部表,结果失败了,它把所有表都锁定了,错在哪里?
 \'锁定所有外部表 外部数据源名称"SQL2008"

    Dim lst As List(Of String)
    lst = Connections("sql2008").GetTableNames
    For Each nm As String In lst
        Tables(nm).AllowEdit=False
    Next


--  作者:狐狸爸爸
--  发布时间:2016/3/18 8:03:00
--  

答案在这里:
http://www.foxtable.com/help/topics/1353.htm


 
For Each dt As DataTable In DataTables
     if dt.ConnectionName > "" Then
        dt.AllowEdit = False
    End if
next