以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 跨数据库取数 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=162122) |
-- 作者:zhuxinhui -- 发布时间:2021/4/6 16:17:00 -- 跨数据库取数 现在有两个数据库都是ACCESS,数据库放在局域网的主机里,我又不想把二个数据源加载在一起,现在想A数据库的B表直接采另一个数据库的C表的数,有什么办法可以直接采取呢???? |
-- 作者:有点蓝 -- 发布时间:2021/4/6 16:39:00 -- 通过sql加载:http://www.foxtable.com/webhelp/topics/2137.htm |
-- 作者:zhuxinhui -- 发布时间:2021/4/6 19:49:00 -- 已学习了 |
-- 作者:zhuxinhui -- 发布时间:2021/4/6 19:51:00 -- 我想采集数据后,在外部表相应行的列注上备注,这个要怎样写 |
-- 作者:zhuxinhui -- 发布时间:2021/4/6 19:53:00 -- 此主题相关图片如下:qq截图20210406195226.jpg |
-- 作者:有点蓝 -- 发布时间:2021/4/6 20:52:00 -- http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=69632 示例五 ExecuteReader有一个可选参数,如果设置为True,那么生成的DataTable不仅可以增加、删除和修改数据,还可以保存。 Dim cmd As new SQLCommand |
-- 作者:zhuxinhui -- 发布时间:2021/4/7 8:44:00 -- 多谢 |
-- 作者:zhuxinhui -- 发布时间:2021/4/8 9:41:00 -- Dim cmd As New SQLCommand Dim dt As DataTable Dim sCols() As String = {"单据编码","客户全称","单据类型","送货日期","货品编码","产品名称","规格","单位","数量","含税单价","含税金额","税率","不含税金额","税额","合同号"} Dim dCols() As String = {"单号","往来名称","单据类型","日期","货物编码","货物名称","规格","单位","数量","含税单价","含税金额","税率","不含税金额","税额","合同号"} cmd.C cmd.CommandText = "SELECT * Fr om {销售明细}" dt = cmd.ExecuteReader(True) \'For Each dr1 As DataRow In DataTables("销售开单").Select("[会计年度] Is not null") \'For Each dr As DataRow In dt.DataRows \'If dr("过帐") = Nothing Then \'Dim nr As DataRow = DataTables("销售明细").AddNew() \'For i As Integer =0 To sCols.Length -1 \'nr(dCols(i)) = dr(sCols(i)) \'Next \'dr("过帐") = 123 \'End If \'Next 这样还是不行
|
-- 作者:有点蓝 -- 发布时间:2021/4/8 10:15:00 -- 没有保存 cmd.CommandText = "SELECT * From {销售明细} where 过帐 is null" dt = cmd.ExecuteReader(True) For Each dr As DataRow In dt.DataRows Dim nr As DataRow = DataTables("销售明细").AddNew() For i As Integer =0 To sCols.Length -1 nr(dCols(i)) = dr(sCols(i)) Next dr("过帐") = 123 Next dt.save |
-- 作者:zhuxinhui -- 发布时间:2021/4/8 10:29:00 -- 多谢 |