troubleshooting Question

Attempted to read or write protected memory. this is often an indication that other memory is corrupt.

Avatar of RegProctor
RegProctorFlag for United States of America asked on
MySQL Server
14 Comments1 Solution2905 ViewsLast Modified:
Hello Experts,

I am running MySQL (installed the latest version about 2 months ago) on a windows 2000 server. I am connected to it through the MySQL ODBC version 3.51.12.

I am connecting to it through Visual Studio 2005 (VS) using VB.net on an Win XP client computer.  VB works fine in reading the tables and data, writing to the DB and so on. Then, all of sudden I started getting the above error.  Looking around on the Internet others seem to have had this problem but no -one seems to have posted a solution that I have found.

Any help greatly appreciated. This is urgent because if I can't fix this I'll have to throw away most of my development and start again with another DB. Aside from the loss in development time, I like MySQL and so I am really hoping an incompatibility between the MySQL ODBC and VB.Net does not become a problem.

This is the line that the error occurs on:
            Dim CustomersChanges As DStruWest.CustomersDataTable = gDS.Customers.GetChanges()
            If Not CustomersChanges Is Nothing Then Me.CustomersTableAdapter.Update(CustomersChanges) ' ERROR ********************
This gives the same result: Me.CustomersTableAdapter.Update(DStruWest.CustomersDataTable)

When I trace all the auto-generated code it is the last line of the routine (upon returning from it) that the error actually occurs:
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private ReadOnly Property Adapter() As System.Data.Odbc.OdbcDataAdapter
            Get
                If (Me._adapter Is Nothing) Then
                    Me.InitAdapter
            End If
            Return Me._adapter
            End Get
        End Property


Here is the stack trace:
"   at System.Data.Common.UnsafeNativeMethods.SQLExecDirectW(OdbcStatementHandle StatementHandle, String StatementText, Int32 TextLength)
   at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
   at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
   at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Odbc.OdbcCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.UpdateRowExecute(RowUpdatedEventArgs rowUpdatedEvent, IDbCommand dataCommand, StatementType cmdIndex)
   at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
   at truWest.DStruWestTableAdapters.CustomersTableAdapter.Update(CustomersDataTable dataTable)
   at truWest.Customer.SaveData()"
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros