重新连接到Excel工作簿时发生OLEDB AccessViolationException异常

重新连接到Excel工作簿时发生OLEDB AccessViolationException异常,excel,vb.net,oledb,access-violation,uipath,Excel,Vb.net,Oledb,Access Violation,Uipath,我目前正在使用UiPath(Visual Basic)自动化流程。 过程的一部分使用大型excel文件,因此我使用OLEDB和SQL与它们交互 在我个人的VDI上测试没有问题,但是在Azure VM上部署时,我的OLEDB连接出现问题 第一次使用OLEDB连接到Excel工作簿是可行的,但在断开连接并处理后,如果尝试重新连接到同一Excel工作簿,则会出现AccessViolationExceptions Description: The process was terminated due t

我目前正在使用UiPath(Visual Basic)自动化流程。 过程的一部分使用大型excel文件,因此我使用OLEDB和SQL与它们交互

在我个人的VDI上测试没有问题,但是在Azure VM上部署时,我的OLEDB连接出现问题

第一次使用OLEDB连接到Excel工作簿是可行的,但在断开连接并处理后,如果尝试重新连接到同一Excel工作簿,则会出现AccessViolationExceptions

Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at System.Data.OleDb.DataSourceWrapper.InitializeAndCreateSession(System.Data.OleDb.OleDbConnectionString, System.Data.OleDb.SessionWrapper ByRef)
   at System.Data.OleDb.OleDbConnectionInternal..ctor(System.Data.OleDb.OleDbConnectionString, System.Data.OleDb.OleDbConnection)
   at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(System.Data.Common.DbConnectionOptions, System.Data.Common.DbConnectionPoolKey, System.Object, System.Data.ProviderBase.DbConnectionPool, System.Data.Common.DbConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(System.Data.Common.DbConnectionOptions, System.Data.Common.DbConnectionPoolKey, System.Object, System.Data.ProviderBase.DbConnectionPool, System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionPoolGroup, System.Data.Common.DbConnectionOptions)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(System.Data.Common.DbConnection, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal, System.Data.ProviderBase.DbConnectionInternal ByRef)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions)
   at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory)
   at System.Data.OleDb.OleDbConnection.Open()
   at UiPath.Database.DatabaseConnection.OpenConnection()
   at UiPath.Database.DatabaseConnection..ctor(System.String, System.String)
   at UiPath.Database.Activities.DatabaseConnect+<>c__DisplayClass12_0.<BeginExecute>b__0()
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr, System.Object[], System.Object, System.Object[] ByRef)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)
   at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(System.Object)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

谢谢大家

此错误与windows系统体系结构、系统32和64有关。当系统创建OleDb实例时,他调用MSCorlib,它位于不同的目录中,x(86)等等。

Hmm,我遇到了相同的问题(这是新的行为)。你解决过这个问题吗?
Provider=Microsoft.ACE.OLEDB.12.0;Data Source= {0};Extended Properties='Excel 12.0 Xml;HDR=YES;Readonly=False;IMEX=1';