Vb NET更新失败 [英] Vb NET update failure

查看:68
本文介绍了Vb NET更新失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序用于监控我的自制程序。它已有二十年历史,但去年我用V2017重写了它。它使用DAO 3.6数据库。

两周前它开始无故更新失败 - 总是可能是W-10升级。

当我进入部分失败处于调试模式的程序我在'Upgrade'命令System.AccessViolationException:'尝试读取或写入受保护的内存时出现以下错误。

这只发生在一个文件中数据库。其他文件升级完美。

我用Visual Data Manager(VB6附带的工具)检查了文件,看起来很完美。

帮助!



我复制了以下完整的例外情况:



I have a programme I use to monitor my homebrewing. It is twenty years old but last year I rewrote it using V2017. It uses a DAO 3.6 database.
Two weeks ago it began failing with updates for no reason - always possibly a W-10 upgrade.
When I go into the part of the programme where the fail is in debug mode I get the following error at the 'Upgrade' command "System.AccessViolationException: 'Attempted to read or write protected memory."
This only happens with one file in the database. Other files upgrade perfectly.
I have inspected the file with Visual Data Manager (a tool that came with VB6) and it looks perfect.
Help !

I have copied the full exception details below:

-		$exception	{"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}	System.AccessViolationException
+		Data	{System.Collections.ListDictionaryInternal}	System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
		HResult	-2147467261	Integer
		HelpLink	Nothing	String
+		IPForWatsonBuckets	&H00000000	System.UIntPtr
+		InnerException	Nothing	System.Exception
		IsTransient	False	Boolean
		Message	"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."	String
		RemoteStackTrace	Nothing	String
		Source	"BOOZ"	String
		StackTrace	"   at DAO.Recordset.Update(Int32 UpdateType, Boolean Force)" & vbCrLf & "   at BOOZ.frmMaster.UpdateSaveToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Users\Ned\Documents\Development\BOOZ303 - VB-Net 2017\BOOZ\BOOZ\bzMaster.vb:line 342" & vbCrLf & "   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)" & vbCrLf & "   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)" & vbCrLf & "   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)" & vbCrLf & "   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)" & vbCrLf & "   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)" & vbCrLf & "   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)" & vbCrLf & "   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)" & vbCrLf & "   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)" & vbCrLf & "   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)" & vbCrLf & "   at System.Windows.Forms.Control.WndProc(Message& m)" & vbCrLf & "   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)" & vbCrLf & "   at System.Windows.Forms.ToolStrip.WndProc(Message& m)" & vbCrLf & "   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)" & vbCrLf & "   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)" & vbCrLf & "   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)" & vbCrLf & "   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)" & vbCrLf & "   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)" & vbCrLf & "   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)" & vbCrLf & "   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)" & vbCrLf & "   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)" & vbCrLf & "   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()" & vbCrLf & "   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()" & vbCrLf & "   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)" & vbCrLf & "   at BOOZ.My.MyApplication.Main(String[] Args) in :line 81"	String
+		TargetSite	{Void Update(Int32, Boolean)}	System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
+		WatsonBuckets	{Length=5616}	Object {Byte()}
		_HResult	-2147467261	Integer
		_accessType	0	Integer
		_className	Nothing	String
+		_data	{System.Collections.ListDictionaryInternal}	System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
		_dynamicMethods	Nothing	Object
+		_exceptionMethod	{Void Update(Int32, Boolean)}	System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
		_exceptionMethodString	Nothing	String
		_helpURL	Nothing	String
+		_innerException	Nothing	System.Exception
+		_ip	&H0F3FB4A8	System.IntPtr
+		_ipForWatsonBuckets	&H00000000	System.UIntPtr
		_message	"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."	String
		_remoteStackIndex	0	Integer
		_remoteStackTraceString	Nothing	String
+		_safeSerializationManager	{System.Runtime.Serialization.SafeSerializationManager}	System.Runtime.Serialization.SafeSerializationManager
		_source	"BOOZ"	String
+		_stackTrace	{Length=768}	Object {SByte()}
		_stackTraceString	Nothing	String
+		_target	&H0000002C	System.IntPtr
+		_watsonBuckets	{Length=5616}	Object {Byte()}
		_xcode	-1073741819	Integer
+		_xptrs	&H010FD52C	System.IntPtr





我尝试过:



我已经尝试将dll文件更改为另一个版本以防损坏 - 没有欢乐



What I have tried:

I have tried changing the dll files to another version in case that is corrupt - no joy

推荐答案

exception {试图读取或写入受保护的内存。这通常表示其他内存已损坏。} System.AccessViolationException
+ Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collection s.ListDictionaryInternal}
HResult -2147467261整数
HelpLink Nothing String
+ IPForWatsonBuckets& H00000000 System.UIntPtr
+ InnerException Nothing System.Exception
IsTransient False Boolean
消息尝试读取或写入受保护的内存。这通常表明其他内存已损坏。String
RemoteStackTrace Nothing String
SourceBOOZString
StackTraceat DAO.Recordset.Update(Int32 UpdateType,Boolean Force)& ; vbCrLf&at BOOZ.frmMaster.UpdateSaveToolStripMenuItem_Click(Object sender,EventArgs e)in C:\ Users \ Ned \ Files \ Development> \\ BOOZ303 - VB-Net 2017 \ BOOZ \ BOOZ\bzMaster .vb:第342行& vbCrLf&在System.Windows.Forms.ToolStripItem.RaiseEvent(Object key,EventArgs e)& vbCrLf&at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) & vbCrLf&在System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)& vbCrLf&处于System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)& vbCrLf&at at System.Windows.Forms.ToolStripItem.F中的System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e,ToolStripItemEventType met)& vbCrLf& ireEvent(EventArgs e,ToolStripItemEventType met)& vbCrLf& 在System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)& vbCrLf& 在System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)& vbCrLf& 在System.Windows.Forms.Control.WmMouseUp(消息& m,MouseButtons按钮,Int32点击)& vbCrLf& 在System.Windows.Forms.Control.WndProc(Message& m)& vbCrLf& 在System.Windows.Forms.ScrollableControl.WndProc(Message& m)& vbCrLf& 在System.Windows.Forms.ToolStrip.WndProc(Message& m)& vbCrLf& 在System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)& vbCrLf& 在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)& vbCrLf& 在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)& vbCrLf& 在System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)& vbCrLf& 在System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)& vbCrLf& at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID,Int32 reason,Int32 pvLoopData)& vbCrLf& 在System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason,ApplicationContext context)& vbCrLf& 在System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,ApplicationContext context)& vbCrLf& 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()& vbCrLf& 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()& vbCrLf& 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String [] commandLine)& vbCrLf& at BOOZ.My.MyApplication.Main(String [] Args)in:第81行String
+ TargetSite {Void Update(Int32,Boolean)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
+ WatsonBuckets {Length = 5616} Object {Byte()}
_HResult -2147467261整数
_accessType 0整数
_className Nothing String
+ _data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
_dynamicMethods Nothing Object
+ _exceptionMethod {Void Update(Int32,Boolean)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
_exceptionMethodString Nothing String
_helpURL Nothing String
+ _innerException Nothing System.Exception
+ _ip& H0F3FB4A8 System.IntPtr
+ _ipForWatsonBuckets& H00000000 System.UIntPtr
_message尝试读取或写入受保护的内存。这通常表明其他内存已损坏。 String
_remoteStackIndex 0整数
_remoteStackTraceString Nothing String
+ _safeSerializationManager {System.Runtime.Serialization.SafeSerializationManager} System.Runtime.Serialization.SafeSerializationManager
_sourceBOOZString
+ _stackTrace {Length = 768} Object {SByte()}
_stackTraceString Nothing String
+ _target& H0000002C System.IntPtr
+ _watsonBuckets {Length = 5616} Object {Byte()}
_xcode -1073741819整数
+ _xptrs& H010FD52C System.IntPtr
exception {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."} System.AccessViolationException + Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal} HResult -2147467261 Integer HelpLink Nothing String + IPForWatsonBuckets &H00000000 System.UIntPtr + InnerException Nothing System.Exception IsTransient False Boolean Message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." String RemoteStackTrace Nothing String Source "BOOZ" String StackTrace " at DAO.Recordset.Update(Int32 UpdateType, Boolean Force)" & vbCrLf & " at BOOZ.frmMaster.UpdateSaveToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Users\Ned\Documents\Development\BOOZ303 - VB-Net 2017\BOOZ\BOOZ\bzMaster.vb:line 342" & vbCrLf & " at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)" & vbCrLf & " at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)" & vbCrLf & " at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)" & vbCrLf & " at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)" & vbCrLf & " at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)" & vbCrLf & " at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)" & vbCrLf & " at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)" & vbCrLf & " at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)" & vbCrLf & " at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)" & vbCrLf & " at System.Windows.Forms.Control.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.ScrollableControl.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.ToolStrip.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)" & vbCrLf & " at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)" & vbCrLf & " at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)" & vbCrLf & " at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)" & vbCrLf & " at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)" & vbCrLf & " at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)" & vbCrLf & " at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()" & vbCrLf & " at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()" & vbCrLf & " at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)" & vbCrLf & " at BOOZ.My.MyApplication.Main(String[] Args) in :line 81" String + TargetSite {Void Update(Int32, Boolean)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo} + WatsonBuckets {Length=5616} Object {Byte()} _HResult -2147467261 Integer _accessType 0 Integer _className Nothing String + _data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal} _dynamicMethods Nothing Object + _exceptionMethod {Void Update(Int32, Boolean)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo} _exceptionMethodString Nothing String _helpURL Nothing String + _innerException Nothing System.Exception + _ip &H0F3FB4A8 System.IntPtr + _ipForWatsonBuckets &H00000000 System.UIntPtr _message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." String _remoteStackIndex 0 Integer _remoteStackTraceString Nothing String + _safeSerializationManager {System.Runtime.Serialization.SafeSerializationManager} System.Runtime.Serialization.SafeSerializationManager _source "BOOZ" String + _stackTrace {Length=768} Object {SByte()} _stackTraceString Nothing String + _target &H0000002C System.IntPtr + _watsonBuckets {Length=5616} Object {Byte()} _xcode -1073741819 Integer + _xptrs &H010FD52C System.IntPtr





我尝试过:



我尝试将dll文件更改为另一个版本,以防损坏 - 没有欢乐



What I have tried:

I have tried changing the dll files to another version in case that is corrupt - no joy


With只是堆栈跟踪和错误消息,它是不可能告诉你发生了什么。



你在frmMaster中的某个地方使用字典会发生一些事情.UpdateSaveToolStripMenuItem_Click代码或它调用的一段代码。我们看不到代码,所以我们不能说出了什么问题。



DAO已经死了很长时间了。我建议使用ADO.NET重做数据库代码。您仍然可以使用您一直使用的Access数据库(假设!),但只需重写应用程序中的数据库访问代码以消除对DAO的依赖。
With just the stack trace and en error message, it's impossible to tell you what's going on.

There is something going on with a Dictionary you're using somewhere in the frmMaster.UpdateSaveToolStripMenuItem_Click code or some piece of code it calls. We can't see the code, so we can't say what's wrong.

DAO has been dead for a really long time. I'd suggest redoing the database code using ADO.NET. You can still use the Access database you've been using (assumption!) but just rewrite the database access code in your app to remove the dependence on DAO.


已解决 - 其中一个索引在我的数据库上已损坏。我删除它,程序运行正常。它必定是由Microsoft Windows更新引起的,因为数据库的备份副本可以追溯到许多卫星显示同样的问题但一个月前工作正常。

我可能仍会在更多时候重写到目前为止的代码(我很好),但压力已经消失。

感谢您的帮助。
Solved - one of the indexes on my database was corrupt. I deleted it and the programme worked fine. It must have been caused by something like a Microsoft Windows update because backup copies of the database going back many moons showed the same problem but worked fine a month ago.
I probably will still rewrite in more up-to-date code (I'm well into that) but the pressure is off.
Thanks for your help.


这篇关于Vb NET更新失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆