Archive for April, 2011

April 30th, 2011

MS Access – JET SHOWPLAN

I came across an article about optimizing queries using a hidden JET tool call SHOWPLAN which basically generates a showplan.out file (which is merely a text file) which elaborates the method used by Access to execute the query. With this information it is possible to perform optimizations, determine which fields require indexing…

I'm not going to rewrite the article, if the subject interests you, then simply look at the source article.

That said, I did want to try and add a little more information for anyone trying to get Showplan to work on Windows 7 (possibly Windows Vista – untested). To be able to use ShowPlan one must create a registry entry to enable it. In the original atricle, they indicate that the base registry key is found at:

\\HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\JET\4.0\Engines

this may be the case for Windows XP, but if you are using Windows 7 (and I suspect Vista as well) you will not find this key. Instead look for:

\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines

The above mentioned article appears to have been moved to: Use Microsoft Jet's ShowPlan to write more efficient queries.

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
April 23rd, 2011

Domain Registry of Canada – a SCAM?

I recently got a letter in the mail from Domain Registry of Canada indicating I had to renew 2 domains. Their letter, and envelop is as close as you can get to resembling official Government of Canada letterhead, but isn’t. Actually what then send out in an invoice for services, for which you have not yet even signed up for! But if you return the letter with payment you are in fact agreeing to switch your business over to them!

Domain Registry of Canada Letter

Domain Registry of Canada Letter

So what or who is Domain Registry of Canada exactly? They are merely a domain registrar, a company that offer the service of registering your website address (your .com, .ca, .net, …).

Here is some of their info (all freely available on the internet)
From their own website, we get their contact information:

Domain Registry of Canada
PO Box 4577
Markham, Ontario
L3R 5M7
Tel: (866) 434-0212

From the Better Business Bureau we find out the ‘kind’ people who run this nice business are:

Simon Benlolo - President
Mr. Peter Kuryliw - Vice President Oper
Mr. Alvin Chen, Supervisor 

So how did they get my contact information? Well, when you register your domain you have to give contact information and for the most part, this information is freely accessible by anyone, unless you pay extra to make it private which almost no one does!

Are they running a scam? I guess not, as they are offering a service, but the method in which they are doing it is most questionable to say the least. They used deceipt and confusion to get new clients!

What should I do? Simply put, nothing! Ignore the letter. If you did your own domain registry, then simply renew it yourself. If on the other hand you had a web developer, friend, … do this for you, contact them and ask them to ensure it is re-registered for another year, or 2, or 5…! Ignore these people. I would not ever want to deal with people, or a company that basically prey on people and send out this type of ‘marketing’ materials. If this is their business ethics… Beyond which, their fees are x4 more than anything I have ever made my clients pay. It is highway robbery, but I no many people will fall for their letter, be all worried and get locked into doing business with them,but hopefully this post will save a few people from making this mistake!!! Other online article simply suggest posting their return envelop (without putting any postage on it) so they end up having to pay for postage and then they have to process an empty envelop wasting their time. It is up to you.

If you are a Canadian, I would urge you to file a complaint by using the Online form found at http://www.competitionbureau.gc.ca/eic/site/cb-bc.nsf/frm-eng/GH%C3%89T-7TDNA5 and referencing http://www.competitionbureau.gc.ca/eic/site/cb-bc.nsf/eng/00528.html in your complaint. The more people complain, the more likely this type of practice will be stopped! It is up to you and only takes a few minutes of your time and may save other people from being had!!!!!

Throw their paperwork in the garbage, complain about them to your local MNA, your local Better Business Bureau, but please do not fall for their antics!

Other Links of Interest:

Simply Google to find many more stating the same thing.

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
April 11th, 2011

MS Access – VBA – Append/Insert Record into Another External Database

So how can one take data from one database and insert it into another database?

There are 2 methods that come to mind and both are quick and easy to implement.

 

Specifying the Database to Append to in Your SQL Statement

The first method is to modify your query to include the external database as a reference. A basic Insert query would look something along the lines of:

INSERT INTO TableName ( Field1, Field2, ...)
VALUES ( Value1, Value2, ...);

but did you know you can also include, as part of your SQL statement, the database to append the data into?! So we could easily modify the SQL statement like:

INSERT INTO TableName ( Field1, Field2, ...) In 'FullPathAndDbNameWithExtension'
VALUES ( Value1, Value2, ...);

Here’s a concrete example:

INSERT INTO Temp1( FirstName, LastName) In 'C:\Databases\Clients.mdb'
VALUES ( "Don", "Hilman");

 

Using Linked Tables

Another approach is to merely create a linked table to your secondary database and then run a normal append query on your linked table!

Either way, as you can clearly see for yourself, it is not a hard thing to insert data into a table contained within another external database!

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
April 8th, 2011

MS Access – VBA – Determine Where a Field Is Used

I recently had to make a minor change to a poorly designed, but large database and had to determine where certain fields were being used so I could go make the necessary changes. In this case, I had to review hundreds of MS Access objects, so a manual approach was just not acceptable. As such, I created a VBA to let the computer do the checking for me and report back. Below is the fruits of my labor.

'---------------------------------------------------------------------------------------
' Procedure : FindFieldUsedWhere
' Author    : Daniel Pineault, CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Locate where a field is used within queries, forms and reports
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Input Variables:
' ~~~~~~~~~~~~~~~~
' sFieldName    : Field Name to search for in the various Access objects
'
' Usage:
' ~~~~~~
' FindFieldUsedWhere("Type A")
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2011-04-08                 Initial Release
'---------------------------------------------------------------------------------------
Function FindFieldUsedWhere(sFieldName As String)
On Error GoTo Error_Handler
    Dim db               As DAO.Database
    Dim qdf              As DAO.QueryDef
    Dim sSQL             As String
    Dim ctl              As Control
    Dim frm              As AccessObject
    Dim DbO              As AccessObject
    Dim DbP              As Object
 
    Set db = CurrentDb
    Debug.Print "FindFieldUsedWhere Begin"
    Debug.Print "Searching for '" & sFieldName & "'"
    Debug.Print "================================================================================"
 
    'Check Queries
    For Each qdf In db.QueryDefs
        'qdf.Name    'The current query's name
        'qdf.SQL     'The current query's SQL statement
        sSQL = qdf.SQL
        If InStr(sSQL, sFieldName) Then
            'The Query is a Make Table Query and has our TableName we are looking for
            Debug.Print "Query: " & qdf.Name
        End If
    Next
 
    'Check Forms
    For Each frm In CurrentProject.AllForms
        DoCmd.OpenForm frm.Name, acDesign
        If InStr(Forms(frm.Name).RecordSource, sFieldName) Then
            'The Query is a Make Table Query and has our TableName we are looking for
            Debug.Print "Form: " & frm.Name
        End If
        'Loop throught the Form Controls
        For Each ctl In Forms(frm.Name).Form.Controls
            Select Case ctl.ControlType
                Case acComboBox
                    If Len(ctl.Tag) > 0 Then
                        If InStr(ctl.Tag, sFieldName) Then
                            'The Query is a Make Table Query and has our TableName we are looking for
                            Debug.Print "Form: " & frm.Name & " :: Control: " & ctl.Name
                        End If
                        If InStr(ctl.ControlSource, sFieldName) Then
                            'The Query is a Make Table Query and has our TableName we are looking for
                            Debug.Print "Form: " & frm.Name & " :: Control: " & ctl.Name
                        End If
                    End If
                Case acTextBox, acCheckBox
                    If InStr(ctl.ControlSource, sFieldName) Then
                        'The Query is a Make Table Query and has our TableName we are looking for
                        Debug.Print "Form: " & frm.Name & " :: Control: " & ctl.Name
                    End If
            End Select
        Next ctl
        DoCmd.Close acForm, frm.Name, acSaveNo
    Next frm
 
    'Check Reports
    Set DbP = Application.CurrentProject
    For Each DbO In DbP.AllReports
        DoCmd.OpenReport DbO.Name, acDesign
        If InStr(Reports(DbO.Name).RecordSource, sFieldName) Then
            'The Query is a Make Table Query and has our TableName we are looking for
            Debug.Print "Report: " & DbO.Name
        End If
        'Loop throught the Report Controls
        For Each ctl In Reports(DbO.Name).Report.Controls
            Select Case ctl.ControlType
                Case acComboBox
                    If Len(ctl.Tag) > 0 Then
                        If InStr(ctl.Tag, sFieldName) Then
                            'The Query is a Make Table Query and has our TableName we are looking for
                            Debug.Print "Report: " & DbO.Name & " :: Control: " & ctl.Name
                        End If
                        If InStr(ctl.ControlSource, sFieldName) Then
                            'The Query is a Make Table Query and has our TableName we are looking for
                            Debug.Print "Report: " & DbO.Name & " :: Control: " & ctl.Name
                        End If
                    End If
                Case acTextBox, acCheckBox
                    If InStr(ctl.ControlSource, sFieldName) Then
                        'The Query is a Make Table Query and has our TableName we are looking for
                        Debug.Print "Report: " & DbO.Name & " :: Control: " & ctl.Name
                    End If
            End Select
        Next ctl
        DoCmd.Close acReport, DbO.Name, acSaveNo
    Next DbO
 
    Debug.Print "================================================================================"
    Debug.Print "FindFieldUsedWhere End"
 
Error_Handler_Exit:
    On Error Resume Next
    Set qdf = Nothing
    Set db = Nothing
    Set ctl = Nothing
    Set frm = Nothing
    Set DbP = Nothing
    Set DbO = Nothing
    Exit Function
 
Error_Handler:
    MsgBox "The following error has occured" & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: FindFieldUsedWhere" & vbCrLf & _
           "Error Description: " & Err.Description, vbCritical, "An Error has Occured
    Resume Error_Handler_Exit
End Function

This is my first draft and I haven’t looked at optimizing my code. It was more about getting results than developing a procedure to be reused often. Hopefully it can help someone else in the same boat as I found myself! Simply execute the procedure and it will return a listing of what Access objects use the specified field in the immediate window of the VBE console.

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
April 7th, 2011

MS Access – VBA – Relink Back-End Tables

In any well developed MS Access database it becomes necessary to automate the relinking of the back-end database tables. There are any number of existing resources that you can very rapidly implement.

Below are a few useful link to get you going:

In complexe database setups, it may become necessary to relink your database to multiple back-ends. I started out writting my own code to do this and then came accross nice sample from David Fenton Associates:

Hopefully these links will save you some time searching the net.

Share and Enjoy

  • Google Plus
  • Facebook
  • LinkedIn
  • Twitter
  • Email
  • Print
April 6th, 2011

GE 1.1 Cu Ft Microwave – JES1142WPC – Review

My wife and I owned a GE micorwave for several years (purchased from Zellers) which we have had for 6+ yrs. It worked great! But after working beautifully for many years, started to shows its’ age and so we went out and decided to purchase another GE unit.

We ended up purchasing a GE 1.1 Cu Ft Turntable Microwave from WalMart.

Sadly, neither of us is very happy with this purchase! Especially when compared with our previous GE. Here are the top reason why we are dissatisfied:

  • The Kitchen Timer resets itself – say you are in the process of cooking something and you want to setup the kitchen timer and then go and insert the item in your oven, when you return to the microwave to actually start the timer, the microwave has gone back to clock mode?! Why!?
  • Inconsistent Heating – sometimes the food comes out piping hot and other times not so much. Other times the food is cold but the plate are burning hot?
  • Inconsistent Time Entry Format – depending on which function you activate, the way you enter time changes. This is very frustrating and for no reason. Just poor programming on GE’s part!
  • Sparking/Burning of Vegetables – I have tried to cook various vegetables and many of them litterally start sparking and/or burning in this microwave!
  • Sliding Around – when you activate a function, and especially when you open the microwave door, the unit slides around all over the counter. The microwave pads (feet) are simply not doing the job.
  • So basically, GE sure isn’t producing a product of quality like they previously did. I would not recommend this unit and would most probably stay away from GE as a whole if this is any indication of the level of thought, product testing and quality the are now putting forth!

    Share and Enjoy

    • Google Plus
    • Facebook
    • LinkedIn
    • Twitter
    • Email
    • Print