Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cmcubism
Helper I
Helper I

Unexpected error: Attempted to read or write protected memory.

Hi there,

I have updated to the actual November release.

After that I have experienced the following error in all of my workbooks using my ODBC Connection:

 

Unexpected error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Details:
    Microsoft.Mashup.Evaluator.Interface.ErrorException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Microsoft.Mashup.Engine1.Library.Odbc.Interop.OdbcConnectionHandle.GetInfo1(SQL_INFO info, Byte[] buffer)
   at Microsoft.Mashup.Engine1.Library.Odbc.Interop.OdbcConnectionHandle.GetInfoInt32Unhandled(SQL_INFO info, Int32& resultValue)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcService.OdbcEngineConnection.GetInfoInt32(SQL_INFO infoType)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcCachingService.OdbcCachingConnection.OdbcFunctionCaching.GetResult[Output](UInt16 input, Func`3 function)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcTracingService.OdbcTracingConnection.<>c__DisplayClass8.<GetInfoInt32>b__7(IHostTrace trace)
   at Microsoft.Mashup.Engine1.Library.Common.Tracer.Trace[T](String method, Func`2 func)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcTracingService.OdbcTracingConnection.GetInfoInt32(SQL_INFO infoType)
   at Microsoft.Mashup.Engine1.Library.Odbc.UserOverrideOdbcService.UserOverrideOdbcConnection.GetInfoInt32(SQL_INFO infoType)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSourceInfo.OdbcConnectionDataSourceInfo.GetInt32OrDefault(SQL_INFO infoType, Int32 defaultValue)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSourceInfo.OdbcMemoryDataSourceInfo..ctor(OdbcConnectionDataSourceInfo dataSourceInfo)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSource.<get_Info>b__0(IOdbcConnection connection)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSource.<>c__DisplayClass9`1.<Connect>b__8()
   at Microsoft.Mashup.Engine1.Library.Common.DbExceptionHandler.RunWithRetryGuard[T](Int32 maxRetryAttempts, Func`1 action)
   at Microsoft.Mashup.Engine1.Library.Common.DbExceptionHandler.Invoke[T](Int32 maxRetry, Func`1 action)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSource.get_Info()
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSource.<>c__DisplayClass17.<ExecuteCore>b__12()
   at Microsoft.Mashup.Engine1.Library.Common.DbExceptionHandler.RunWithRetryGuard[T](Int32 maxRetryAttempts, Func`1 action)
   at Microsoft.Mashup.Engine1.Library.Common.DbExceptionHandler.Invoke[T](Int32 maxRetry, Func`1 action)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSource.ExecuteCore(String commandText, IList`1 parameters, RowRange rowRange, String[] columnNames, ColumnConversion[] columnConversions)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSource.ExecuteCoreDataReader(String commandText, IList`1 parameters, RowRange range, String[] columnNames, ColumnConversion[] columnConversions)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcDataSource.ExecuteWithoutPaging(String commandText, IList`1 parameters, RowRange range, String[] columnNames, ColumnConversion[] columnConversions)
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcNativeQueryTableValue.GetReaderCore()
   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcNativeQueryTableValue.get_Type()
   at Microsoft.Mashup.Engine1.Runtime.TableValue.Take(RowCount count)
   at Microsoft.Mashup.Engine1.Runtime.WrappingTableValue.Take(RowCount count)
   at Microsoft.Mashup.Engine1.Runtime.DelegatingTableValue.Take(RowCount count)
   at Microsoft.Mashup.Engine1.Runtime.TableValue.Take(Value countOrCondition)
   at Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue2`3.Invoke(Value arg0, Value arg1)
   at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(Value frame)
   at Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(Value frame)
   at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(Value frame)
   at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(Value frame)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
   at Microsoft.Mashup.Engine1.Language.MembersFunctionValue0.Invoke()
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters, Action`1 callback)
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters, Action`1 callback)
   at Microsoft.Mashup.Evaluator.FirewallPartition.BeginGetResult[T](Action`1 callback)
   at Microsoft.Mashup.Evaluator.FirewallDocumentEvaluator.Evaluation`1.OnBufferComplete(Exception exception)
   at Microsoft.Mashup.Evaluator.Firewall.BeginBufferPartitions(Action`1 callback)
   at Microsoft.Mashup.Evaluator.FirewallDocumentEvaluator.BeginGetResultInternal[T](DocumentEvaluationParameters parameters, Action`1 callback)
   at Microsoft.Mashup.Evaluator.Interface.IDocumentEvaluatorExtensions.GetResult[T](IDocumentEvaluator`1 evaluator, DocumentEvaluationParameters parameters)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
   at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
   at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass7.<TryReportException>b__6()
   at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host, IHostTrace trace, Action action)
   at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
   at Microsoft.Mashup.Evaluator.EvaluationHost.TryHandleException(Exception exception)
   at Microsoft.Mashup.Evaluator.SafeThread2.HandleException(Exception e)
   at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
   at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
   at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
   at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_TableSource()
   at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_TableSource()
   at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)

 

Kind regards

Christian

 

 

1 ACCEPTED SOLUTION

Dear All,

I have posted this problem also in the issues section of the power BI Forum and it was accepted:

 

https://community.powerbi.com/t5/Issues/ODBC-connection-not-workinf-since-November-update/idc-p/3068...

 

Fortunately this will be fixed in the upcoming December edition!

So hold tight, it won't be long.

 

Kind regards

Christian

View solution in original post

8 REPLIES 8
philmaynard
Regular Visitor

I had exactly the same issue attempting a connection with and ODBC driver to a Sage 50 database - this after any Power BI update in December 2017. I resolved it by changing the default SQL select query to only the columns I needed e.g.

 

SELECT CHART, CATEGORY, FLAG_ASSET_LIABILITY, NAME, LOW, HIGH, SORT_ORDER FROM CATEGORY

rather then the default

 

SELECT * FROM CATEGORY

This has worked for me. I hope it helps someone else

Anonymous
Not applicable

I can't believe it, but your suggestion got it working for me. Unbelievable.

 

Thanks!

Anonymous
Not applicable

Same error here using Firebird ODBC.

I have the same **bleep**in issue. 

i've tried to connect using dsn but still not working. Some help


Dear All,

I have posted this problem also in the issues section of the power BI Forum and it was accepted:

 

https://community.powerbi.com/t5/Issues/ODBC-connection-not-workinf-since-November-update/idc-p/3068...

 

Fortunately this will be fixed in the upcoming December edition!

So hold tight, it won't be long.

 

Kind regards

Christian

Anonymous
Not applicable

@cmcubism, thank you!

I have the same **bleep**in issue. 

i've tried to connect using dsn but still not working. Some help


cmcubism
Helper I
Helper I

Dear all,

the ODBC driver that I use for the firebird SQL relational database:

 

https://firebirdsql.org/en/odbc-driver/

 

All data connections have sometimes comples sql queries in the connection parameters.

Until the newest update everything worked fine without the slightest error.

 

Kind regards

Christian

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.