By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

Connection watching in VB.NET 2008

P: n/a
In VBA/VB6, I had a class (incomplete sample below) that watched and
displayed for the user all connection events, so that I could easily
see what SQL was taking a long time, and when it freezes, I could see
what is the SQL that freezes the program.

I wanted to replicate this for VB.NET, but the SqlConnection object
does not seem to support nearly as rich a set of events as the
ADODB.Connection object. Any ideas where these events went, or how I
would implement something like the below? Thanks in advance.

==================

Option Explicit

Public Enum ConnectionLogState
ConnectionLogStateVisible
ConnectionLogStateBackground
ConnectionLogStateOff
End Enum

Public Enum ConnectionLogVerbosityLevel
ConnectionLogVerbosityLevelLow
ConnectionLogVerbosityLevelMedium
ConnectionLogVerbosityLevelHigh
End Enum

Public Enum ConnectionLogCompletionTimeFormat
ConnectionLogCompletionTimeFormatMixed
ConnectionLogCompletionTimeFormatMS
End Enum

Public Enum ConnectionLogSetting
ConnectionLogSetting_ClearConnectionLog = 0
ConnectionLogSetting_BackgroundConnectionLog = 1
ConnectionLogSetting_KillConnectionLog = 2
ConnectionLogSetting_SetVerbosityHigh = 3
ConnectionLogSetting_SetVerbosityMedium = 4
ConnectionLogSetting_SetVerbosityLow = 5
ConnectionLogSetting_WordWrapEnabled = 6
ConnectionLogSetting_AlwaysOnTop = 7
ConnectionLogSetting_ShowInTaskbar = 8
End Enum
Public Event StateChanged(newState As ConnectionLogState)
Public Event VerbosityChanged(newState As ConnectionLogVerbosityLevel)
Public Event AlwaysOnTopChanged(newState As Boolean)
Public Event TimeFormatChanged(newState As
ConnectionLogCompletionTimeFormat)
Public Event WordWrapChanged(newState As Boolean)
Public Event ShowInTaskbarChanged(newState As Boolean)

'Private WithEvents m_objSettings As frmConnectionLoggerSettings
Private WithEvents m_objConnection As ADODB.Connection
Private WithEvents m_objStatusReporter As StatusReporterUI

Private m_objStopWatch As AveryObjects.StopWatch
Private m_lngConnectionLogVerbosity As ConnectionLogVerbosityLevel
Private m_objConnectionLogCompletionTimeFormat As
ConnectionLogCompletionTimeFormat
Private m_strLastSQL As String
Private m_objSettingsPopup As Office.CommandBar
Private m_lngSettingsVector() As Long
Public Function ChangeState(cs As ConnectionLogState)
Select Case (cs)
Case ConnectionLogStateBackground
StatusReporter.Hide
Case ConnectionLogStateVisible
StatusReporter.Show
End Select
FixFlags
RaiseEvent StateChanged(cs)
End Function

Public Property Get ConnectionLogCompletionTimeFormat() As
ConnectionLogCompletionTimeFormat
ConnectionLogCompletionTimeFormat =
m_objConnectionLogCompletionTimeFormat
End Property

Public Property Get ConnectionLogVerbosity() As
ConnectionLogVerbosityLevel
ConnectionLogVerbosity = m_lngConnectionLogVerbosity
End Property

Public Property Let ConnectionLogCompletionTimeFormat(ByVal Value As
ConnectionLogCompletionTimeFormat)
m_objConnectionLogCompletionTimeFormat = Value
RaiseEvent TimeFormatChanged(Value)
End Property

Public Property Let ConnectionLogVerbosity(ByVal Value As
ConnectionLogVerbosityLevel)
m_lngConnectionLogVerbosity = Value
FixFlags
RaiseEvent VerbosityChanged(Value)
End Property

Public Property Let AlwaysOnTop(Value As Boolean)
m_objStatusReporter.AlwaysOnTop = Value
FixFlags
RaiseEvent AlwaysOnTopChanged(Value)
End Property

Public Property Let Caption(val As String)
m_objStatusReporter.Caption = val
End Property

Public Property Get Caption() As String
Caption = m_objStatusReporter.Caption
End Property

Public Property Get Connection() As ADODB.Connection
Set Connection = m_objConnection
End Property
Public Sub Clear()
m_objStatusReporter.Clear
End Sub
Public Property Set Connection(ByRef Value As ADODB.Connection)
Set m_objConnection = Value
End Property

Public Property Get StatusReporter() As StatusReporterUI
Set StatusReporter = m_objStatusReporter
End Property

Public Property Set StatusReporter(ByRef Value As StatusReporterUI)
Set m_objStatusReporter = Value
FixFlags
End Property
Public Property Get AlwaysOnTop() As Boolean
AlwaysOnTop = m_objStatusReporter.AlwaysOnTop
End Property

Public Sub ToggleAlwaysOnTop()
Me.AlwaysOnTop = Not Me.AlwaysOnTop
End Sub

Public Sub ToggleWordWrap()
m_objStatusReporter.WordWrap = Not m_objStatusReporter.WordWrap
FixFlags
RaiseEvent WordWrapChanged(m_objStatusReporter.WordWrap)
End Sub

Public Sub ToggleShowInTaskBar()
m_objStatusReporter.ShowInTaskbar = Not
m_objStatusReporter.ShowInTaskbar
FixFlags
RaiseEvent ShowInTaskbarChanged(m_objStatusReporter.ShowInTas kbar)
End Sub

Private Sub m_objConnection_BeginTransComplete(ByVal TransactionLevel
As Long, ByVal pError As ADODB.Error, adStatus As
ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection)
'
Dim str As String

If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection BeginTransComplete"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"
If Not pError Is Nothing Then
str = str & " (Error: " & pError.Description & ")"
End If

m_objStatusReporter.AppendEvent str
End If
End Sub

Private Sub m_objConnection_CommitTransComplete(ByVal pError As
ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As
ADODB.Connection)
'
Dim str As String

If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection CommitTransComplete"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"
If Not pError Is Nothing Then
str = str & " (Error: " & pError.Description & ")"
End If

m_objStatusReporter.AppendEvent str
End If

End Sub

Private Sub m_objConnection_ConnectComplete(ByVal pError As
ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As
ADODB.Connection)
'
Dim str As String

Debug.Assert m_objStopWatch.Running
m_objStopWatch.StopTimer

If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection ConnectComplete"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"
If Not pError Is Nothing Then
str = str & " (Error: " & pError.Description & ")"
End If
If m_objStopWatch.SecondsElapsed < 0.1 Then
str = str & " (Time Elapsed: " & Format$
(m_objStopWatch.SecondsElapsed * 1000, "0.0") & " ms)"
Else
str = str & " (Time Elapsed: " & Format$
(m_objStopWatch.SecondsElapsed, "0.00") & " secs)"
End If

m_objStatusReporter.AppendEvent str
End If

End Sub

Private Sub m_objConnection_Disconnect(adStatus As
ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection)
'
Dim str As String

If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection Disconnect"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"

m_objStatusReporter.AppendEvent str
End If
End Sub

Private Sub m_objConnection_ExecuteComplete(ByVal RecordsAffected As
Long, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum,
ByVal pCommand As ADODB.Command, ByVal pRecordset As ADODB.Recordset,
ByVal pConnection As ADODB.Connection)
'
Dim str As String

Debug.Assert m_objStopWatch.Running
m_objStopWatch.StopTimer

If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection ExecuteComplete"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"

Select Case m_objConnectionLogCompletionTimeFormat
Case ConnectionLogCompletionTimeFormatMixed
If m_objStopWatch.SecondsElapsed < 0.1 Then
str = str & " (Time Elapsed: " & Format$
(m_objStopWatch.SecondsElapsed * 1000, "0.0") & " ms)"
Else
str = str & " (Time Elapsed: " & Format$
(m_objStopWatch.SecondsElapsed, "0.00") & " secs)"
End If
Case ConnectionLogCompletionTimeFormatMS
str = str & " (Time Elapsed: " & Space$(8 - Len(Format
$(m_objStopWatch.SecondsElapsed * 1000, "#,##0.0"))) & Format$
(m_objStopWatch.SecondsElapsed * 1000, "#,##0.0") & " ms)"
End Select

If Len(str) < 112 Then
str = str & Space$(112 - Len(str))
End If

If Not pError Is Nothing Then
str = str & " (Error: " & pError.Description & ")"
End If
str = str & " " & ApplyVerbosity(m_strLastSQL)

m_objStatusReporter.AppendEvent str
End If

End Sub

Private Sub m_objConnection_InfoMessage(ByVal pError As ADODB.Error,
adStatus As ADODB.EventStatusEnum, ByVal pConnection As
ADODB.Connection)
'
Dim str As String

If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection InfoMessage"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"
If Not pError Is Nothing Then
str = str & " (Error: " & pError.Description & ")"
End If

m_objStatusReporter.AppendEvent str
End If
End Sub

Private Sub m_objConnection_RollbackTransComplete(ByVal pError As
ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As
ADODB.Connection)
'
Dim str As String

If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection RollbackTransComplete"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"
If Not pError Is Nothing Then
str = str & " (Error: " & pError.Description & ")"
End If

m_objStatusReporter.AppendEvent str
End If
End Sub

Private Sub m_objConnection_WillConnect(ConnectionString As String,
UserID As String, Password As String, Options As Long, adStatus As
ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection)
'
Dim str As String

If m_lngConnectionLogVerbosity <>
ConnectionLogVerbosityLevel.ConnectionLogVerbosity LevelLow Then
If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection WillConnect"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"

str = str & " " & ConnectionString

m_objStatusReporter.AppendEvent str
End If
End If
m_objStopWatch.StartTimer

End Sub

Private Sub m_objConnection_WillExecute(Source As String, CursorType
As ADODB.CursorTypeEnum, LockType As ADODB.LockTypeEnum, Options As
Long, adStatus As ADODB.EventStatusEnum, ByVal pCommand As
ADODB.Command, ByVal pRecordset As ADODB.Recordset, ByVal pConnection
As ADODB.Connection)
'
Dim str As String

If m_lngConnectionLogVerbosity <>
ConnectionLogVerbosityLevel.ConnectionLogVerbosity LevelLow Then
If Not m_objStatusReporter Is Nothing Then

str = Now() & " " & "Connection WillExecute"
str = str & " (Status = " &
Conversion.EventStatusEnumToString(adStatus) & ")"

str = str & " (CursorType = " &
Conversion.CursorTypeEnumToString(CursorType) & ")"
str = str & " (LockType = " &
Conversion.LockTypeEnumToString(LockType) & ")"

If Len(str) < 112 Then
str = str & Space$(112 - Len(str))
End If

If Not pCommand Is Nothing Then
m_strLastSQL = DBFuncts.SQLFromADOCommand(pCommand)
str = str & " " & ApplyVerbosity(m_strLastSQL)
Else
If pRecordset Is Nothing Then
m_strLastSQL = Source
str = str & " " & ApplyVerbosity(m_strLastSQL)
Else
If pRecordset.ActiveCommand Is Nothing Then
m_strLastSQL = Source
str = str & " " &
ApplyVerbosity(m_strLastSQL)
Else
m_strLastSQL =
DBFuncts.SQLFromADOCommand(pRecordset.ActiveComman d)
str = str & " " &
ApplyVerbosity(m_strLastSQL)
End If
End If
End If

m_objStatusReporter.AppendEvent str
End If
End If

m_objStopWatch.StartTimer
End Sub
Private Function ApplyVerbosity(ByRef SQL As String) As String
Select Case m_lngConnectionLogVerbosity
Case ConnectionLogVerbosityLevelLow,
ConnectionLogVerbosityLevelMedium
ApplyVerbosity = Left$(Replace(SQL, vbNewLine, Chr(1)),
75)
Case ConnectionLogVerbosityLevelHigh
ApplyVerbosity = SQL
End Select
End Function
Private Sub m_objStatusReporter_QueryClose(Cancel As Integer)
ChangeState ConnectionLogStateOff
End Sub

Private Sub m_objStatusReporter_ShowSetting(idx As Integer)
Select Case idx
Case m_lngSettingsVector(ConnectionLogSetting_ClearConn ectionLog)
m_objStatusReporter.Clear
Case
m_lngSettingsVector(ConnectionLogSetting_Backgroun dConnectionLog)
ChangeState ConnectionLogStateBackground
Case m_lngSettingsVector(ConnectionLogSetting_KillConne ctionLog)
ChangeState ConnectionLogStateOff
Case m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityHigh)
Me.ConnectionLogVerbosity = ConnectionLogVerbosityLevelHigh
Case m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityMedium)
Me.ConnectionLogVerbosity = ConnectionLogVerbosityLevelMedium
Case m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityLow)
Me.ConnectionLogVerbosity = ConnectionLogVerbosityLevelLow
Case m_lngSettingsVector(ConnectionLogSetting_WordWrapE nabled)
Me.ToggleWordWrap
Case m_lngSettingsVector(ConnectionLogSetting_AlwaysOnT op)
Me.ToggleAlwaysOnTop
Case m_lngSettingsVector(ConnectionLogSetting_ShowInTas kbar)
Me.ToggleShowInTaskBar
End Select
End Sub
Private Sub AddMenuItems()
ReDim m_lngSettingsVector(8)
With m_objStatusReporter
m_lngSettingsVector(ConnectionLogSetting_ClearConn ectionLog)
= .AddSetting("&Clear Connection Log")

m_lngSettingsVector(ConnectionLogSetting_Backgroun dConnectionLog)
= .AddSetting("Back&ground Connection Log")
m_lngSettingsVector(ConnectionLogSetting_KillConne ctionLog)
= .AddSetting("&Kill Connection Log")

m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityHigh)
= .AddSetting("Set Verbosity &High")
m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityMedium)
= .AddSetting("Set Verbosity &Medium")
m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityLow)
= .AddSetting("Set Verbosity &Low")

m_lngSettingsVector(ConnectionLogSetting_WordWrapE nabled)
= .AddSetting("&Word Wrap Enabled")
m_lngSettingsVector(ConnectionLogSetting_AlwaysOnT op)
= .AddSetting("&Always On Top")
m_lngSettingsVector(ConnectionLogSetting_ShowInTas kbar)
= .AddSetting("&Show In Taskbar")
End With
End Sub

Private Sub FixFlags()
If m_objStatusReporter Is Nothing Then Exit Sub
With m_objStatusReporter
.SetSettingChecked
m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityHigh),
m_lngConnectionLogVerbosity = ConnectionLogVerbosityLevelHigh
.SetSettingChecked
m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityMedium),
m_lngConnectionLogVerbosity = ConnectionLogVerbosityLevelMedium
.SetSettingChecked
m_lngSettingsVector(ConnectionLogSetting_SetVerbos ityLow),
m_lngConnectionLogVerbosity = ConnectionLogVerbosityLevelLow
.SetSettingChecked
m_lngSettingsVector(ConnectionLogSetting_WordWrapE nabled), .WordWrap
.SetSettingChecked
m_lngSettingsVector(ConnectionLogSetting_AlwaysOnT op), .AlwaysOnTop
.SetSettingChecked
m_lngSettingsVector(ConnectionLogSetting_ShowInTas kbar), .ShowInTaskbar
End With
End Sub


'
' Dim cbc As Office.CommandBarButton
' For Each cbc In m_objSettingsPopup.Controls
' Select Case cbc.Caption
' Case "Set Verbosity &High"
' If m_lngConnectionLogVerbosity =
ConnectionLogVerbosityLevelHigh Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "Set Verbosity &Medium"
' If m_lngConnectionLogVerbosity =
ConnectionLogVerbosityLevelMedium Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "Set Verbosity &Low"
' If m_lngConnectionLogVerbosity =
ConnectionLogVerbosityLevelLow Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "&Word Wrap Enabled"
' If m_objStatusReporter.WordWrap Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
'
' Case "&Always On Top"
' If m_objStatusReporter.AlwaysOnTop Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "&Visible By Default"
' If Preferences.ConnectionLogDefaultState =
ConnectionLogStateVisible Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "&Background By Default"
' If Preferences.ConnectionLogDefaultState =
ConnectionLogStateBackground Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "&Off By Default"
' If Preferences.ConnectionLogDefaultState =
ConnectionLogStateOff Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' End Select
' Next cbc
'
' m_objSettingsPopup.ShowPopup

Private Sub ShowSettings()
' If m_objSettings Is Nothing Then
' Set m_objSettings = New frmConnectionLoggerSettings
' End If
'
' m_objSettings.ConnectionState = ConnectionLogStateVisible
' m_objSettings.ConnectionVerbosity = m_lngConnectionLogVerbosity
' m_objSettings.Show
''This method shows a settings popup menu for the ConnectionLoggerUI
object.
' ' check to see if there is an appropriate command bar floating
around.
' If m_objSettingsPopup Is Nothing Then
' Dim cb As Office.CommandBar
' For Each cb In Application.CommandBars
' If cb.Name = "ufConnectionLoggerUISettings" Then
' Set m_objSettingsPopup = cb
' Exit For
' End If
' Next cb
' End If
'
'' Application.CommandBars("ufConnectionLoggerUISetti ngs").Delete
'' Set m_objSettingsPopup = Nothing
'
' If m_objSettingsPopup Is Nothing Then
' Set m_objSettingsPopup =
Application.CommandBars.Add("ufConnectionLoggerUIS ettings",
msoBarPopup, , True)
' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
' .Caption = "&Clear Connection Log"
' .OnAction = "RequestBufferLogClearUI"
' .Style = msoButtonIconAndCaption
' End With
'
' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
' .Caption = "Back&ground Connection Log"
' .OnAction = "RequestBufferLogBackgroundUI"
' .Style = msoButtonIconAndCaption
' End With
' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
' .Caption = "&Kill Connection Log"
' .OnAction = "KillUberfunctionsConnectionLoggerUI"
' .Style = msoButtonIconAndCaption
' End With
'
' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
' .Caption = "Set Verbosity &High"
' .OnAction = "SetRequestBufferLogVerbosityHighUI"
' .Style = msoButtonIconAndCaption
' .BeginGroup = True
' End With
' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
' .Caption = "Set Verbosity &Medium"
' .OnAction = "SetRequestBufferLogVerbosityMediumUI"
' .Style = msoButtonIconAndCaption
' End With
' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
' .Caption = "Set Verbosity &Low"
' .OnAction = "SetRequestBufferLogVerbosityLowUI"
' .Style = msoButtonIconAndCaption
' End With
' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
' .Caption = "&Word Wrap Enabled"
' .OnAction = "UberfunctionsConnectionLoggerToggleWordWrap"
' .Style = msoButtonIconAndCaption
' .BeginGroup = True
' End With
' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
' .Caption = "&Always On Top"
' .OnAction =
"UberfunctionsConnectionLoggerToggleAlwaysOnTo p"
' .Style = msoButtonIconAndCaption
' End With
'
'' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
'' .Caption = "&Visible By Default"
'' .OnAction =
"UberfunctionsConnectionLoggerVisibleByDefault "
'' .Style = msoButtonIconAndCaption
'' .BeginGroup = True
'' End With
'' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
'' .Caption = "&Background By Default"
'' .OnAction =
"UberfunctionsConnectionLoggerBackgroundByDefa ult"
'' .Style = msoButtonIconAndCaption
'' End With
'' With m_objSettingsPopup.Controls.Add(msoControlButton, , , ,
True)
'' .Caption = "&Off By Default"
'' .OnAction = "UberfunctionsConnectionLoggerOffByDefault"
'' .Style = msoButtonIconAndCaption
'' End With
' End If
'
' Dim cbc As Office.CommandBarButton
' For Each cbc In m_objSettingsPopup.Controls
' Select Case cbc.Caption
' Case "Set Verbosity &High"
' If m_lngConnectionLogVerbosity =
ConnectionLogVerbosityLevelHigh Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "Set Verbosity &Medium"
' If m_lngConnectionLogVerbosity =
ConnectionLogVerbosityLevelMedium Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "Set Verbosity &Low"
' If m_lngConnectionLogVerbosity =
ConnectionLogVerbosityLevelLow Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "&Word Wrap Enabled"
' If m_objStatusReporter.WordWrap Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
'
' Case "&Always On Top"
' If m_objStatusReporter.AlwaysOnTop Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "&Visible By Default"
' If Preferences.ConnectionLogDefaultState =
ConnectionLogStateVisible Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "&Background By Default"
' If Preferences.ConnectionLogDefaultState =
ConnectionLogStateBackground Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' Case "&Off By Default"
' If Preferences.ConnectionLogDefaultState =
ConnectionLogStateOff Then
' cbc.State = msoButtonDown
' Else
' cbc.State = msoButtonUp
' End If
' End Select
' Next cbc
'
' m_objSettingsPopup.ShowPopup
End Sub
Private Sub Class_Initialize()
Set m_objStatusReporter = New StatusReporterUI
AddMenuItems
Set m_objStopWatch = New AveryObjects.StopWatch

m_objConnectionLogCompletionTimeFormat =
ConnectionLogCompletionTimeFormatMS
End Sub
Private Sub Class_Terminate()
Set m_objStatusReporter = Nothing
Set m_objStopWatch = Nothing
End Sub
Sep 9 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.