7

We're trying to get some usage metrics on a VB6 application that we are targeting for migration into newer technologies. It is fairly massive (so big that its brushing up against the limits on numbers of forms etc. that VB6 has) and retrofitting some kind of custom monitoring in itself would not be a small task.

I was hoping that tools like DeskMetrics (I'm not singling them out) would have some kind of legacy COM control that we could drop into every form and with a bit of application level configuration and install of a local (on-site) set of web services we could capture some statistics that would allow us to make some decisions.

However:

  1. There are no directly compatible VB6 libraries available for any of these tracking systems that I could find

  2. Because our customer's sites aren't necessarily fully connected to the internet, we're having trouble finding any platform that can have an install locally at a customer site that is not connected to the wider internet.

So my questions is, are there any libraries/3rd-parties that do fulfil these requirements or are we best off rolling our own very simple tracking solution to a database and collecting that information by some kind of report.

BradleyDotNET
  • 60,462
  • 10
  • 96
  • 117
Kieran Benton
  • 8,739
  • 12
  • 53
  • 77

2 Answers2

2

Did you rule out google analytics already? If not this might be a solution

It's been a while for VB6 for me but pretty sure this will work

Create a user control and place a web browser control in side it. Then make the control auto navigate to your own website to a blank page which just has the analytics code on it. On the query string add in the form that is been displayed. This will give you basic form usage information.

If you need to track things further add a method to the control to log events and use ExecScript to call into the analytics api to pass the required information for that form.

Once the control is working should be a simple matter of dropping it onto each form. (You will want to get it to hide it self at runtime of course)

Of course this all relies on your clients having access to internet from their workstation

Dreamwalker
  • 3,032
  • 4
  • 30
  • 60
  • Do you know if there is anything off the shelf that will do something like this? This sounds plausible (if against the T&Cs of GA) but requires both some server side work as well as some high level integration into VB6. – Kieran Benton Mar 11 '12 at 15:34
  • Unfortunately I don't know of any off the self system for VB6 I am currently using google analytics my self with a business silverlight app which is fine to do. The server side work needed for what I suggest is actually very minimal it can be a normal HTML page that links to the analytics code which google give you when you sign up the rest is done automatically with their scripts. The work really would be the VB side. – Dreamwalker Mar 12 '12 at 13:16
  • 1
    I can confirm this works, and quite well actually. I didn't implement the events, but passing simple query strings more than meets my needs. – RyanMac Nov 08 '14 at 00:07
0

I did have a project recently where I needed to do something similar. I created a class called clsTrace

Option Explicit
Private m_RoutineName As String
Public Sub StartTrace(RoutineName As String)
    m_RoutineName = RoutineName
    TraceIndent = TraceIndent + 1
    Call writeout("Start " & RoutineName)
End Sub
Private Sub EndTrace(s As String)
    Call writeout("End " & m_RoutineName)
    TraceIndent = TraceIndent - 1
End Sub
Private Sub Class_Terminate()
    Call EndTrace(m_RoutineName)
End Sub
Private Sub writeout(sMessage As String)
    'write to database, file, screen, etc
End Sub

Added a global var called TraceIndent

Then I wrote a little program to look at the frm, bas, cls files and find function and sub defs (eg Public Sub Private Function Friend Function, etc) along with the names of the defs. After the def, I inserted the line Dim cTrace as new clsTrace: cTrace.StartTrace(NameOfSourceFile.NameOfFunction).

Because a class is destroyed when exiting a sub\function, the class_terminate will be called automatically on exit. If done correctly, this will produce an indented log file of every entry and exit of your functions\subs.

You should be able to use the output to determine how many times a button was clicked or how many times a form was opened (look for "Start frmName.buttonName_Click" entries).

bugtussle
  • 1,416
  • 11
  • 15
  • I have to agree I'm afraid - you're essentially just describing logging and not any kind of consolidated usage tracking. – Kieran Benton Mar 11 '12 at 15:35