以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 导入的时候提示不可识别的数据库格式 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=123816) |
-- 作者:zaq3574020 -- 发布时间:2018/8/23 18:01:00 -- 导入的时候提示不可识别的数据库格式 连接外部数据库创建好的表: 要从Excel导入数据:
1.使用Merger 实例二中的代码如下:
Dim dlg As New OpenFileDialog \'定义一个新的OpenFileDialog dlg.Filter= "Excel文件|*.xls|Excel文件|*.xlsx" \'设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮 Dim mg As New Merger mg.SourcePath = dlg.FileName mg.SourceTableName = "花色$" mg.DataTableName = "花色" mg.Merge() End If 就会出现不可识别的数据库格式 2.如果直接使用示例7 Dim mg As New
Merger 可以使用,找了论坛看别人发了贴 没有人解答。有没有知道怎么回事。 在线等 火钳刘明 [此贴子已经被作者于2018/8/23 18:38:07编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/8/23 20:13:00 -- Dim dlg As New OpenFileDialog \'定义一个新的OpenFileDialog dlg.Filter= "Excel文件|*.xls|Excel文件|*.xlsx" \'设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮 Dim mg As New Merger mg.SourcePath = dlg.FileName If dlg.FileName.EndsWith(".xls") mg.Format = "excel" \'指定格式 Else mg.Format = "excel2007" \'指定格式 End If mg.SourceTableName = "花色$" mg.DataTableName = "花色" mg.Merge() End If [此贴子已经被作者于2018/8/23 20:14:57编辑过]
|
-- 作者:zaq3574020 -- 发布时间:2018/8/24 9:26:00 -- 可以了 搞定了 感谢大哥。 |
-- 作者:zaq3574020 -- 发布时间:2018/8/24 9:33:00 -- 以下是引用有点蓝在2018/8/23 20:13:00的发言:
Dim dlg As New OpenFileDialog \'定义一个新的OpenFileDialog dlg.Filter= "Excel文件|*.xls|Excel文件|*.xlsx" \'设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮 Dim mg As New Merger mg.SourcePath = dlg.FileName If dlg.FileName.EndsWith(".xls") mg.Format = "excel" \'指定格式 Else mg.Format = "excel2007" \'指定格式 End If mg.SourceTableName = "花色$" mg.DataTableName = "花色" mg.Merge() End If 大哥,现在是可以导入了,但是导入的数据,如果那一列设置了,禁止重复,是不会生效,还可以正常导入,变成有重复的数据 [此贴子已经被作者于2018/8/23 20:14:57编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/8/24 9:38:00 -- 要去除重复要手工编码导了:http://www.foxtable.com/webhelp/scr/2334.htm |