以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  怎么判断某个表是否存在数据库表中呢?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=180176)

--  作者:cnsjroom
--  发布时间:2022/10/4 11:38:00
--  怎么判断某个表是否存在数据库表中呢?

怎么判断某个表是否存在数据库表中呢?

 

当前代码如下:

cmd1.CommandText = "se le ct * from 文书名称表"
If cmd1.ExecuteScalar > 0 Then
    Dim dt As DataTable = cmd1.ExecuteReader()
    Dim Products As List(Of String)
    Products = dt.sqlGetValues("对应表名")
    For Each Product As String In Products
          cmd1.CommandText = "D ELE TE FROM {" & Product & "} "
          cmd1.ExecuteNonQuery()
    Next
End If


--  作者:y2287958
--  发布时间:2022/10/5 14:24:00
--  

Dim lst As List(Of String)
lst = Connections("nwnd").GetTableNames
For Each
nm As String In lst
    Output.Show(nm)

Next


--  作者:有点蓝
--  发布时间:2022/10/6 9:41:00
--  
参考:http://www.foxtable.com/webhelp/topics/1943.htm

使用sql,比如:https://blog.csdn.net/bingbangx/article/details/118359229