以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]导出关联的数据到ACCESS (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=45104) |
||||
-- 作者:pyh6918 -- 发布时间:2014/1/15 18:27:00 -- [求助]导出关联的数据到ACCESS 求助:1.导出主表用户为ar的数据 2.同时导出关联表中用户=ar,编号=主表中导出的全部编号 3.同时导出非关联表中用户=ar,编号=主表中导出的全部编号 这三个表同时导出到一个ACCESS文件中。各位帮忙!
[此贴子已经被作者于2014-1-15 18:27:51编辑过]
|
||||
-- 作者:有点甜 -- 发布时间:2014/1/15 19:30:00 -- 用下面的代码,自己修改整理一下 FileSys.DeleteFile("d:\\test.mdb", 2, 2) Dim ex As New Exporter ex.SourceTableName = "主表" \'指定导出表 ex.filepath = "d:\\test.mdb" \'指定目标文件 ex.Filter = "用户 = \'ar\'" ex.Export() \'开始导出 Dim nums As String = DataTables("主表").GetComboListString("编号", "用户 = \'ar\'") nums = "\'" & nums.Replace("|", "\',\'") & "\'" ex = new Exporter ex.SourceTableName = "关联表" ex.FilePath = "d:\\test.mdb" ex.Filter = "编号 in (" & nums & ")" ex.Export() ex = new Exporter ex.SourceTableName = "非关联表" ex.FilePath = "d:\\test.mdb" ex.Filter = "编号 in (" & nums & ")" ex.Export() |
||||
-- 作者:pyh6918 -- 发布时间:2014/1/15 20:17:00 -- 非常感谢! |
||||
-- 作者:atiwhl5 -- 发布时间:2020/2/9 21:53:00 -- 以下是引用有点甜在2014/1/15 19:30:00的发言:
用下面的代码,自己修改整理一下 FileSys.DeleteFile("d:\\test.mdb", 2, 2) Dim ex As New Exporter ex.SourceTableName = "主表" \'指定导出表 ex.filepath = "d:\\test.mdb" \'指定目标文件 ex.Filter = "用户 = \'ar\'" ex.Export() \'开始导出 Dim nums As String = DataTables("主表").GetComboListString("编号", "用户 = \'ar\'") nums = "\'" & nums.Replace("|", "\',\'") & "\'" ex = new Exporter ex.SourceTableName = "关联表" ex.FilePath = "d:\\test.mdb" ex.Filter = "编号 in (" & nums & ")" ex.Export() ex = new Exporter ex.SourceTableName = "非关联表" ex.FilePath = "d:\\test.mdb" ex.Filter = "编号 in (" & nums & ")" ex.Export() 导入怎们弄
|
||||
-- 作者:有点蓝 -- 发布时间:2020/2/9 21:58:00 -- 参考:http://www.foxtable.com/webhelp/topics/0685.htm |