System.AccessViolationException: Attempted to read or write protected memory

zogota

New Member
I am getting the following error while trying to read from an excel file in my server."System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."The code runs smoothly in localhost, but the error comes when i host it online.I am unable to post the stacktrace as i do not get error everytime, but the executions stops at the line "objConn.open". The page just says loading... and nothing happens.Here is my code block :\[code\] fuGroupAttributes.SaveAs(IO.Path.Combine(Server.MapPath("~/Admin/SpecificationExcels"), lblParentId.Text.Trim & IO.Path.GetExtension(fuGroupAttributes.FileName)))'saving the excel file from the fileUploader Dim path As String = Server.MapPath("~/Admin/SpecificationExcels/" & lblParentId.Text.Trim & IO.Path.GetExtension(fuGroupAttributes.FileName))'getting the file path from the server Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & path & ";Extended Properties=Excel 12.0;" Dim objConn As New OleDbConnection(connectionString) **objConn.Open()** 'this is where i am getting the error. Dim strConString As String = "SELECT * FROM [Sheet1$]"\[/code\]
 
Back
Top