Broken Reference to MSCAL.OCX (1 Viewer)

jonathanchye

Registered User.
Local time
Today, 21:26
Joined
Mar 8, 2011
Messages
448
Hi all,

I am planning a company wide upgrade to Office 2010 and I've found one database which has the following error while trying to run the DB

" You Microsoft Access database or project contains a missing or broken reference to the file 'MSCAL.OCX' version 7.0 "

I am opening this DB in Access 2010. I wonder if there is a safe and quick fix to this problem? (without the need of total overhaul of the DB)

Thank you.

edit: I've found a solution here :

http://social.technet.microsoft.com...o/thread/29a50b8f-70f4-4b1d-a29b-4bad20de42a2

and I am thinking of using the first recommendation (using date picker). However, how would I track down the forms needing changes? Do I only need to look for controls with fields that accepts Dates? How about Queries and reports?
 

DCrake

Remembered
Local time
Today, 21:26
Joined
Jun 8, 2005
Messages
8,632
Here is some code that attempts to fix broken references:

Code:
Function FixUpRefs()
    Dim loRef As Access.Reference
    Dim intCount As Integer
    Dim intX As Integer
    Dim blnBroke As Boolean
    Dim strPath As String

    On Error Resume Next

    'Count the number of references in the database
    intCount = Access.References.Count

    'Loop through each reference in the database
    'and determine if the reference is broken.
    'If it is broken, remove the Reference and add it back.
   
    For intX = intCount To 1 Step -1
        Set loRef = Access.References(intX)
        With loRef
            blnBroke = .IsBrokene
            strPath = .FullPath
            If blnBroke = True Or Err <> 0 Then
                strPath = .FullPath
                With Access.References
                    .Remove loRef
                    .AddFromFile strPath
                End With
            End If
        End With
    Next

    Set loRef = Nothing

    ' Call a hidden SysCmd to automatically compile/save all modules.
    Call SysCmd(504, 16483)
End Function
 

jonathanchye

Registered User.
Local time
Today, 21:26
Joined
Mar 8, 2011
Messages
448
Hi DCrake,

thanks for the code. However, I think in my case the problem lies in the Calander control.

I have read that one of the best recommendation is to use Access 2010's DatePicker.

I am just not sure of how to deploy this. Do I need to go through every forms to change the date-related controls and fields? Do I need to also scan through all queries and reports?

Will your code provide a simple solution to this? It seems to me that your code only fixes broken references but won't address the issues of the reference used in old DB not supported in Access 2010? I could be wrong though..

Here is some code that attempts to fix broken references:

Code:
Function FixUpRefs()
    Dim loRef As Access.Reference
    Dim intCount As Integer
    Dim intX As Integer
    Dim blnBroke As Boolean
    Dim strPath As String

    On Error Resume Next

    'Count the number of references in the database
    intCount = Access.References.Count

    'Loop through each reference in the database
    'and determine if the reference is broken.
    'If it is broken, remove the Reference and add it back.
   
    For intX = intCount To 1 Step -1
        Set loRef = Access.References(intX)
        With loRef
            blnBroke = .IsBrokene
            strPath = .FullPath
            If blnBroke = True Or Err <> 0 Then
                strPath = .FullPath
                With Access.References
                    .Remove loRef
                    .AddFromFile strPath
                End With
            End If
        End With
    Next

    Set loRef = Nothing

    ' Call a hidden SysCmd to automatically compile/save all modules.
    Call SysCmd(504, 16483)
End Function
 

boblarson

Smeghead
Local time
Today, 13:26
Joined
Jan 12, 2001
Messages
32,059
Access 2010's date picker just appears automatically when you click into a text box which is either bound to a date/time field or if unbound it has its format set to date.
 

jonathanchye

Registered User.
Local time
Today, 21:26
Joined
Mar 8, 2011
Messages
448
Access 2010's date picker just appears automatically when you click into a text box which is either bound to a date/time field or if unbound it has its format set to date.

Ah yes, I understand now. So for now, if all I intend to do is to make sure the old DB would be 100% compatible with Access 2010 all I have to do is fix the broken reference using the code sample provided above?

I just don't want any downtime when we do upgrade to Access 2010. It seems that this warning just means a missing reference but I don't know if it would impact the whole DB if we upgrade to Access 2010.
 

jonathanchye

Registered User.
Local time
Today, 21:26
Joined
Mar 8, 2011
Messages
448
I have ran that code but seems that I still have the error. How should I fix the reference?

Edit : It seems that MS ACCESS 2010 doesn't come shipped with Microsoft Calendar Control 11.0 anymore. If I remove this reference would it impact the DB functionality?

If it does would a warning be issued?
 

boblarson

Smeghead
Local time
Today, 13:26
Joined
Jan 12, 2001
Messages
32,059
You would need to remove the reference but also search through the database forms to find the calendar control and remove any of them. The MSCal.Calendar.7 control is very obvious:

 

Attachments

  • mscalcalendar7control.png
    mscalcalendar7control.png
    18.2 KB · Views: 29,630

chacalau

New member
Local time
Tomorrow, 06:26
Joined
Jul 22, 2011
Messages
1
Hello,

I have a similar problem which i hope you can help with.

I did not design the Access database file, so i do not know it intimately.

We are getting the same MSCAL.OCX' version 7.0 error when we open the database.

I understand from the comments above that i can remove the reference to this extension , but i would like to know if this will also make it incompatible with legacy versions of MS Access. Will we still be able to open the database and have in work correctly in Access 2003 and 2007?

Thank you
 

boblarson

Smeghead
Local time
Today, 13:26
Joined
Jan 12, 2001
Messages
32,059
Hello,

I have a similar problem which i hope you can help with.

I did not design the Access database file, so i do not know it intimately.

We are getting the same MSCAL.OCX' version 7.0 error when we open the database.

I understand from the comments above that i can remove the reference to this extension , but i would like to know if this will also make it incompatible with legacy versions of MS Access. Will we still be able to open the database and have in work correctly in Access 2003 and 2007?

Thank you

It isn't just removing the reference, but you would need to remove the control itself and replace it with something else. As for working with Access 2003 and 2007, you would need to use something that is compatible for all three versions.
 

NZArchie

Registered User.
Local time
Tomorrow, 08:26
Joined
May 9, 2011
Messages
84
Bob, is there any cheater way to find a calendar control? I can't see one in my db, and I've set all text boxes to datepicker, but on export to 2010, this missing reference error still comes up. Is there a way to see where the reference is called from?
 

Kiwiman

Registered User
Local time
Today, 21:26
Joined
Apr 27, 2008
Messages
799
Howzit
MS have removed the old Calender active x control and use the datepicker now. This has been sine the 2007 version
 

NZArchie

Registered User.
Local time
Tomorrow, 08:26
Joined
May 9, 2011
Messages
84
Yep cheers man I didn't find a calendar control (had been using date pickers anyway) but there was a long while where it was still throwing the "missing reference" error. I've deleted the missing reference on my 2007 version, in the hopes that this will work with 2010.
 

boblarson

Smeghead
Local time
Today, 13:26
Joined
Jan 12, 2001
Messages
32,059
Bob, is there any cheater way to find a calendar control? I can't see one in my db, and I've set all text boxes to datepicker, but on export to 2010, this missing reference error still comes up. Is there a way to see where the reference is called from?
Yes, there is a way (I stumbled upon this by accident one day) -

Run the Documenter, that Access includes, and just select the option to document the forms. When it throws an error, the error message should have the name of the form which you would then go look at that form.
 

smig

Registered User.
Local time
Today, 23:26
Joined
Nov 25, 2009
Messages
2,209
Access 2010's date picker just appears automatically when you click into a text box which is either bound to a date/time field or if unbound it has its format set to date.
Is there any way to avoid this ?
I made my oun date picker (A modified version of Allen Brown's one)
 

Kiwiman

Registered User
Local time
Today, 21:26
Joined
Apr 27, 2008
Messages
799
Howzit

On the format property tab fo the control, Set "Show Date Picker" = Never.
 

Users who are viewing this thread

Top Bottom