AnsweredAssumed Answered

ArcGIS Desktop 10.0 - ArcMap  crash after successfully accessed the .accdb file.

Question asked by Adhimoolam on Aug 6, 2014
Latest reply on Oct 23, 2015 by SEria-esristaff

Environment is : Window 7, Visual studio 2010 vb.net Frame work 3.5, ArcObject 10.0 .net sdk.

 

I have used the below code in arcobject. BaseCommand implementation  (see the full code in the attached doc) to access the value from the given .accdb file. The code successfully ran and displayed the expected result, when click the command button in ArcMap  - ArcGIS Desktop 10.0. , after 10 or 20 seconds ArcMap shows the attached error message.   

 

Public Overrides Sub OnClick()       

Dim sAccdbPath As String = "" ' "C:\ProgramData\MapManager\Resources\Project\MapManagerProject.accdb"       

Dim pFileOpen As New System.Windows.Forms.OpenFileDialog       

 

If pFileOpen.ShowDialog() = Windows.Forms.DialogResult.OK Then sAccdbPath = pFileOpen.FileName       

If Not String.IsNullOrEmpty(sAccdbPath) AndAlso System.IO.File.Exists(sAccdbPath) Then           

 

Dim sConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & sAccdbPath & ";Persist Security Info=False;"          

Dim sSQL As String = "" '"SELECT * FROM MgrVersion"           

sSQL = InputBox("Enter simple select query : ", "Read .accdb database")       

   

Using connection As New OleDb.OleDbConnection(sConnString)               

Dim pCmd As New OleDb.OleDbCommand(sSQL, connection)              

Dim pRdr As OleDb.OleDbDataReader = Nothing               

Try                   

pCmd.Connection.Open()                   

pRdr = pCmd.ExecuteReader()                   

If pRdr.HasRows Then                       

pRdr.Read()                       

MsgBox(pRdr.Item(0))                   

End If               

Catch ex As Exception                   

MsgBox(ex.ToString)               

End Try           

End Using       

Else           

MsgBox("Invalid file")     

 

End If   

End Sub

 

PS: Arcobject 10.0 alos crash after connect the .accdb file using oledb connection.

 

Even deploy this dll in to the banlk arcgis desktop 10.0 installed machine,  there also happeing the same.

Kindly help to clear this issue.

Outcomes