以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- 此行已从表中移除并且没有任何数 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=160607)
|
-- 作者:漂亮美眉vszh
-- 发布时间:2021/2/8 10:21:00
-- 此行已从表中移除并且没有任何数
有两个内容和表结构都一模一样的数据库,A和B
进入软件后,默认连接A,点击按钮切换连接到B数据库
连接B时,
打开并登陆成功后,出来以下提示
此主题相关图片如下:微信图片_20210208101911.png

************** 异常文本 ************** System.Data.RowNotInTableException: 此行已从表中移除并且没有任何数据。BeginEdit() 将允许在此行中创建新数据 在 System.Data.DataRow.GetDefaultRecord() 在 System.Data.DataRow.get_Item(String columnName) 在 Foxtable.WinForm.Form.O__oo0O__O.0.(Object A_0, EventArgs A_1) 在 System.Windows.Forms.Control.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 在 C1.Win.C1Input.C1Button.OnMouseUp(MouseEventArgs mevent) 在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ButtonBase.WndProc(Message& m) 在 System.Windows.Forms.Button.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** 已加载的程序集 ************** mscorlib 程序集版本:4.0.0.0 Win32 版本:4.8.4250.0 built by: NET48REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll ---------------------------------------- Foxtable 程序集版本:2020.1.19.19 Win32 版本:2020.01.19.19 基本代码:file:///C:/foxtable/Development/foxtable.exe ---------------------------------------- Foxtable.Lib 程序集版本:2019.8.1.1 Win32 版本:2019.08.01.1 基本代码:file:///C:/foxtable/Development/Foxtable.Lib.DLL ---------------------------------------- Microsoft.VisualBasic 程序集版本:10.0.0.0 Win32 版本:14.8.3761.0 built by: NET48REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll ---------------------------------------- System 程序集版本:4.0.0.0 Win32 版本:4.8.4200.0 built by: NET48REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Core 程序集版本:4.0.0.0 Win32 版本:4.8.4270.0 built by: NET48REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Windows.Forms 程序集版本:4.0.0.0 Win32 版本:4.8.4270.0 built by: NET48REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing 程序集版本:4.0.0.0 Win32 版本:4.8.3761.0 built by: NET48REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Configuration 程序集版本:4.0.0.0 Win32 版本:4.8.4190.0 built by: NET48REL1LAST_B 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml 程序集版本:4.0.0.0 Win32 版本:4.8.3761.0 built by: NET48REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- C1.Win.C1Ribbon.4 程序集版本:4.0.20191.359 Win32 版本:4.0.20191.359 基本代码:file:///C:/foxtable/Development/C1.Win.C1Ribbon.4.DLL ---------------------------------------- Interop.JinDI_SmsComLib 程序集版本:1.0.0.0 Win32 版本:1.0.0.0 基本代码:file:///C:/foxtable/Development/Interop.JinDI_SmsComLib.DLL ---------------------------------------- System.Data 程序集版本:4.0.0.0 Win32 版本:4.8.4270.0 built by: NET48REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll ----------------------------------------
|
-- 作者:有点蓝
-- 发布时间:2021/2/8 10:21:00
--
按钮写了什么代码?
|
-- 作者:漂亮美眉vszh
-- 发布时间:2021/2/8 11:49:00
--
st_1 = "Provider=SQLOLEDB.1;Password=" & ** & ";Persist Security Info=True;User ID=sa;Initial Catalog=" & 数据库名 & "bak;Data Source=" & Values(2)
Syscmd.Project.Open(ProjectFile,st_1)
|
-- 作者:漂亮美眉vszh
-- 发布时间:2021/2/8 11:52:00
--
BeforeConnectOuterDataSource内代码 e.ConnectionString = OpenFileArgs(0)
|
-- 作者:漂亮美眉vszh
-- 发布时间:2021/2/8 11:53:00
--
AfterOpenProject内代码
If OpenFileArgs.Count = 0 Then msgbox("连接了老的数据源") Forms("AQPQ登陆窗口").Open() If vars("conn") > "" Then Syscmd.Project.Open(ProjectFile,vars("conn")) Return
end if
end if
|
-- 作者:有点蓝
-- 发布时间:2021/2/8 13:33:00
--
如果AfterOpenProject有使用Syscmd.Project.Open,按钮里就不要调用Syscmd.Project.Open了
|
-- 作者:漂亮美眉vszh
-- 发布时间:2021/2/8 15:50:00
--
AfterOpenProject内代码 ,只有一句
If OpenFileArgs.Count = 0 Then msgbox("连接了老的数据源") Forms("AQPQ登陆窗口").Open() If vars("conn") > "" Then Syscmd.Project.Open(ProjectFile,vars("conn")) Return
end if
end if
我把这句Syscmd.Project.Open(ProjectFile,vars("conn")) 注释掉了,然后打开还是报错
|
-- 作者:有点蓝
-- 发布时间:2021/2/8 15:56:00
--
应该去掉按钮里的Syscmd.Project.Open,保留AfterOpenProject里的Syscmd.Project.Open
|
-- 作者:漂亮美眉vszh
-- 发布时间:2021/2/8 17:36:00
--
测试结果:
1.去掉按钮内的Syscmd.Project.Open(ProjectFile,st_1) ,软件不会重启。手动重启后,未连接上B数据库;
2.把按钮内的Syscmd.Project.Open(ProjectFile,st_1),改成Syscmd.Project.Open(ProjectFile),依旧报错
3.又重新测试了一遍,把按钮内的或AfterOpenProject内代码,只留一个,依旧报错。也找不到原因,但连接A数据库就没有这个问题.估计还是切换的问题,但又找不出哪里有问题。
|
-- 作者:有点蓝
-- 发布时间:2021/2/8 20:28:00
--
按钮没有给全局变量vars("conn")赋值吧
|