Problem with MySQLMonitor

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Locked
Hostonet

Problem with MySQLMonitor

Post by Hostonet » Mon 10 Jan 2005 18:41

Hello,

I Have the follwing error when I use MySQLMonitor in
Microsoft Visual Basic 2003 :

Failure of QueryInterface for interface CoreLab.DbMonitor.h.

:roll:

Cordially,

Didier Lombet
HOSTONET

Oleg
Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Re: Problem with MySQLMonitor

Post by Oleg » Tue 11 Jan 2005 14:38

In what application do you use MySQLMonitor?
If in ASP.NET please read an article "Using DBMonitor" in the documentation.
This article has a full instruction how to configure DBMonitor.
Try to download DBMonitor 2.10. You need certainly remove old version of DBMonitor before installing a new one.

Hostonet

Post by Hostonet » Tue 11 Jan 2005 17:27

Hi,

Thanks for your reply , but my solution is not ASP.net

See my class below :

Code: Select all

Public Class MySQLState
    Inherits CoreLab.MySql.MySqlMonitor

#Region "Windows Form"[...]

    Public Enum State
        Disconected = 0
        Connected = 1
        Connecting = 2
        Disconecting = 3
        Executing = 4
        Selecting = 5
        Updating = 6
        Deleting = 7
        Inserting = 8
        Dumping = 9
        Fetching = 10
        Uploading = 11
        Downloading = 12
        FlushingPrivileges = 13
        FlushingTable = 14
        Ready = 15
        Broken = 16
        CreatingTable = 17
        DropingTable = 18
        Undefined = 19
    End Enum

    Public Event StateChanged(ByVal sender As Object, ByVal e As MySQLState.State)

    Private mState As State = State.Disconected

    Public Property CurrentState() As State
        Get
            Return mState
        End Get

        Set(ByVal Value As State)

            If Value = mState Then Return

            If Not DesignMode Then      '// If not in design mode the propertie can be change
                mState = Value
                RaiseEvent StateChanged(Me, Value)

            End If


        End Set
    End Property

    Private Function FindText(ByVal searchText As String, ByVal Text As String) As Boolean

        Dim TmpTextBox As New RichTextBox
        TmpTextBox.Text = Text
        Dim indexToText As Integer = TmpTextBox.Find(searchText, 0, Len(TmpTextBox.Text), RichTextBoxFinds.MatchCase)

        If indexToText >= 0 Then
            TmpTextBox.Dispose()
            Return True
        Else
            TmpTextBox.Dispose()
            Return False
        End If

    End Function

    Private Sub MySQLState_TraceEvent(ByVal sender As Object, ByVal e As CoreLab.Common.MonitorEventArgs) Handles MyBase.TraceEvent

        Select Case e.TracePoint

            Case CoreLab.Common.MonitorTracePoint.BeforeEvent

                If FindText("INSERT INTO", UCase(e.Description)) = True Then

                    If Not CurrentState = State.Inserting Then
                        CurrentState = State.Inserting
                    End If

                ElseIf FindText("DELETE", UCase(e.Description)) = True Then

                    If Not CurrentState = State.Deleting Then
                        CurrentState = State.Deleting
                    End If

                ElseIf FindText("UPDATE", UCase(e.Description)) = True Then
                    If Not CurrentState = State.Updating Then
                        CurrentState = State.Updating
                    End If

                ElseIf FindText(UCase("Disconnect"), UCase(e.Description)) = True Then

                    If Not CurrentState = State.Disconected Then
                        CurrentState = State.Disconected
                    End If

                ElseIf FindText(UCase("Can't connect to MySQL server"), UCase(e.Description)) = True Then

                    If Not CurrentState = State.Disconected Then
                        CurrentState = State.Disconected
                    End If

                ElseIf FindText(UCase("ConnectionString"), UCase(e.Description)) = True Then

                    If Not CurrentState = State.Connecting Then
                        CurrentState = State.Connecting
                    End If

                ElseIf FindText("SELECT", UCase(e.Description)) = True Then

                    If Not CurrentState = State.Selecting Then
                        CurrentState = State.Selecting
                    End If

                ElseIf FindText("CREATE TABLE", UCase(e.Description)) = True Then

                    If Not CurrentState = State.CreatingTable Then
                        CurrentState = State.CreatingTable
                    End If

                ElseIf FindText("DROP TABLE", UCase(e.Description)) = True Then

                    If Not CurrentState = State.DropingTable Then
                        CurrentState = State.DropingTable
                    End If
                Else

                    If Not CurrentState = State.Undefined Then
                        CurrentState = State.Undefined
                    End If

                End If

            Case CoreLab.Common.MonitorTracePoint.AfterEvent
                ' Nothing at this time

        End Select

    End Sub

    Protected Overrides ReadOnly Property ProductName() As String
        Get
            Return "Hostonet Advanced MySQL Monitoring"
        End Get
    End Property

End Class
I put my custom control in my project, it work perfectly but when the solution is wait short time with no action , he return this error.

The same problem with directly use MySQLMonitor.traceevent instead of my custom control.

Cordialy ,

Didier Lombet
HOSTONET

Oleg
Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Post by Oleg » Thu 13 Jan 2005 16:11

DBMonitor version installed at you doesn't correspond to MySQLDirect .NET.
Please test it with MySQLDirect .NET 2.70.2 and DBMonitor 2.10.

Locked