以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]FoxTable停止工作问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=95740) |
-- 作者:黄训良 -- 发布时间:2017/2/4 10:35:00 -- [求助]FoxTable停止工作问题 FoxTable停止工作问题,如下图: 这个问题出现的频率越来越多,让人找不到问题所在,很多时候重启FT解决,经常这样使我对FT产生了放弃的想法,比如下面的代码,单独运行正常;一字不动,放在另一个项目中就会使FT停止工作。 关键是有问题FT你要报错误在哪儿,不能”停止工作“完事! Dim dlg As new SaveFileDialog dlg.FileName = CurrentTable.Name If dlg.ShowDialog = DialogResult.OK Then If FileSys.FileExists(dlg.FileName) = True FileSys.DeleteFile(dlg.FileName,2,2) End If Dim str_oleConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FileSys.GetParentPath(dlg.FileName) & ";Extended Properties=dBASE IV;" Dim ole_conn As New System.Data.OleDb.OleDbConnection(str_oleConn) Try ole_conn.Open() Dim str As String = "" For Each c As Col In CurrentTable.cols str &= "[" & c.name & "] ntext," Next Dim cmd1 As New System.Data.OleDb.OleDbCommand("Create Table " & FileSys.GetName(dlg.FileName) & " (" & str.Trim(",") & ")", ole_conn) cmd1.ExecuteNonQuery() Dim r As Row = CurrentTable.Current Dim cname As String str = "" For Each c As Col In CurrentTable.cols str &= "\'" & r(c.name) & "\'," cname &= "," & c.Name Next Dim cmd2 As New System.Data.OleDb.OleDbCommand("Insert Into " & FileSys.GetName(dlg.FileName) & " (" & cname.trim(",") & ") values (" & str.Trim(",") & ")", ole_conn) cmd2.ExecuteNonQuery() msgbox("保存成功") ole_conn.Close() Catch ex As Exception MessageBox.Show(ex.Message) Finally ole_conn.Close() End Try End If
[此贴子已经被作者于2017/2/4 10:42:44编辑过]
|
-- 作者:有点色 -- 发布时间:2017/2/4 11:02:00 -- 这种问题,一般和环境有关,权限问题以及杀毒软件问题。 |