?
Solved

MS Access 2003 Database not running under MS Access 2010

Posted on 2011-05-03
22
Medium Priority
?
836 Views
Last Modified: 2012-05-11
I rely on a custom Access Database that runs fine under Access 2003.  I am trying to run it under MS Access 2010 but receive the following error message:

Microsoft Visual Basic for Applications: Compile Error: Cannot find project or library

The debugger shows an error highlighting the word "Date" in  Me!SelectDate = Date  'Now()

Here is the full context of that error:

    Private Sub Form_Load()
       
    '  Enter parameters in BeginningDate and EndingDate text boxes when
    '  form is loaded.
   c'Now()
    Me!BeginningDate = DateSerial(Format(Date, "yy"), Format(Date, "m") - 6, 1)
    Me!EndingDate = Date


I had to copy some ocx files into the Windows\System32 directory and the Program Files (x86)\Office\Microsoft Office\Office14 directory to get the calendar and other custom forms to work, but they do not seem to be the issue here.

Any thoughts on where to begin fixing this?

Thanks!
0
Comment
Question by:Qualitycomputer
  • 10
  • 8
  • 3
  • +1
22 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 35513754
The problem is clearly one of references.

In any open module choose Tools>References.
Make sure that all the objects/libraries you need are selected and that none is marked as missing.
If any is marked as missing then deselect it and select the correct option from the drop down list below.

Close the References doialog and check things are OK using Debug>Compile.
0
 

Author Comment

by:Qualitycomputer
ID: 35513849
I have the form open that displayed the error that I posted and I select "tools - references".  Unfortunately, "references" is greyed out.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 35514042
You have to keep hitting the 'stop' block on the VBA editor until the code finally stops trying to run and the yellowed line stops being colored.  You may get a message about 'Halt' autoexec.
Then you can get into the references to find the missing one.
Alternatively, opening the db while holding the shift button may open it without any code running.
Then open the editor and try Tools | References
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 7

Expert Comment

by:andymacf
ID: 35514365
I had a similar problem recently, this link might explain for you: ID 26981743
Andy
0
 

Author Comment

by:Qualitycomputer
ID: 35514513
Nick67:  I don't know how to get to the "tool - references" menu if the code is not running.  I have all of my forms listed on the pane on the left side with nothing open in the main window.  Is it possible to check the references from this view? Even with out any forms active or code running the "references' menu is greyed out.  

Andymacf:  That article looks like it might have the fix.  Here is a quote from the article:

"It [ADO] appears in the reference list as 'Microsoft ActiveX Data Objects x.x Library'.  Unless it is required, it should be un-ticked to remove it from the reference list."

Sorry to be so clueless but I don't know how to navigate to that area of the Access 2010.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 35514563
Choose Create>VisualBasic from the ribbon to get to the VBA screen.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 35514627
The debugger menu has Tools and then References
 VBA windowThe square block 'stop' button is just underneath tools

Do you have a 'developer' tab?
That's where you get into the Visual Basic editor, if you don't have a debug error on the go.
If you have no 'developer' tab, you need to turn it on in BackStage options I think
0
 

Author Comment

by:Qualitycomputer
ID: 35514675
I was finally able to stop the code (from the Visual Basic menu) and then the Tools- References was no longer greyed out.  Running "references" I now see that one of the checked boxes is labelled "MISSING: Microsoft Common Dialog Control 6.0".  I unchecked that and then instead of the debugger running it only said that a control was missing.  I restored the file so I am back to where I was.  

What do you think I should do next?  Should I try to install the missing dialog control, and if so, how do I do that?  From the article Experts Exchange article ID 26981743 it seems that it may be possible to use more up-to-date controls (ADE).  Is that possible without the old code that I am running?  The database was originally written from Access 2000.
0
 

Author Comment

by:Qualitycomputer
ID: 35514768
I tried browsing to the Program Files subdirectory that contains a copy of comdlg32.ocx to relink that Active X control but I receive an error "can't add a reference to the specified file".
0
 
LVL 26

Expert Comment

by:Nick67
ID: 35514951
Wrong file I think
Here's where the common controls are on my machine.
Do a search for the file, not the path.
You may need to register it.
conmmon controls
0
 

Author Comment

by:Qualitycomputer
ID: 35515036
I registered MSCOMCTL.OCX from the SysWOW64 directory successfully and moved it higher than the control that is marked "MISSING".  Still, no luck -- the same error is happening.  Visual Basic doesn't recognize the "DATE" reference.
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 2000 total points
ID: 35515049
You HAVE to unmark 'missing' references
0
 

Author Closing Comment

by:Qualitycomputer
ID: 35515091
That did the trick!
0
 

Author Comment

by:Qualitycomputer
ID: 35515129
I spoke to soon.  I was able to get farther but a different report is now giving me the missing reference error:

  Me!SelectDate = Date  'Now()

Should I open a new question since I already awarded points?  Sorry to be inept when it comes to such things.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 35515242
Missing references are an application level problem, it's just that they manifest themselcves as run-time execution problems.
The location of the problem (in the code) is irrelevent to the problem.  The error could occur anywhere.
The fixing has to be done in the References dialog.

As well as missing references there can be problem if the selected file is a different version to the one installed on the run-time machine.
In such cases, it is necessary to deselect everything that can be de-selected,  close and re-open the references dialog and then re-select all the required  libraries.
0
 

Author Comment

by:Qualitycomputer
ID: 35515375
Peter57r:  I tried your suggestion but still no luck.  Should I open a related question so that I can award more points?  The last fix seems to have everything but the calendar control working properly.  I understood your previous comment about it being an application-level problem, yet it would seem that if I can provide a control that will allow my database to call the calendar everything should be fine.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 35515747
Ah, the calendar control!
That has been deprecated in Access 2010
You can get it going again, but it does take some doing.
The file is MSCAL.OCX
You have to find it on an older system.
It HAS to be registered.
I have a VBScript that I built to do it as I acquire more Access 2010 systems
The guts of it are to copy MSCAL.OCX to C:\Program Files (x86)\microsoft office\OFFICE14
and then register it.  After you copy it to the noted location, at a command prompt enter:

C:\windows\system32\RegSvr32 /s C:\Program Files (x86)\microsoft office\OFFICE14\mscal.ocx
0
 

Author Comment

by:Qualitycomputer
ID: 35515963
I think that the control is now registered but it still doesn't work.  I opened another question so that I can award more points.  You have all been incredibly helpful!
0
 
LVL 26

Expert Comment

by:Nick67
ID: 35515995
You have to make it a reference too!
Open Tools | References | Browse and go find it and add it as a reference
0
 
LVL 26

Expert Comment

by:Nick67
ID: 35516095
It takes a little fiddle-farting of opening the form in Design view sometimes.
I think too, I may have copied the registry keys from a unit I got working to the other ones I deployed.
Keep plugging away at it while I look
0
 
LVL 26

Expert Comment

by:Nick67
ID: 35516129
There they are!
One set of keys
 
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\TypeLib\{8E27C92E-1264-101C-8A2F-040224009C02}]

[HKEY_CLASSES_ROOT\TypeLib\{8E27C92E-1264-101C-8A2F-040224009C02}\7.0]
@="Microsoft Calendar Control 11.0"

[HKEY_CLASSES_ROOT\TypeLib\{8E27C92E-1264-101C-8A2F-040224009C02}\7.0\0]

[HKEY_CLASSES_ROOT\TypeLib\{8E27C92E-1264-101C-8A2F-040224009C02}\7.0\0\win32]
@="C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSCAL.OCX"

[HKEY_CLASSES_ROOT\TypeLib\{8E27C92E-1264-101C-8A2F-040224009C02}\7.0\FLAGS]
@="2"

[HKEY_CLASSES_ROOT\TypeLib\{8E27C92E-1264-101C-8A2F-040224009C02}\7.0\HELPDIR]
@="C:\\Program Files (x86)\\Microsoft Office\\Office14"

Open in new window

And the other
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}]
@="Calendar Control 11.0"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Control]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Implemented Categories]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Implemented Categories\{40FC6ED4-2438-11CF-A3DB-080036F12502}]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Implemented Categories\{40FC6ED5-2438-11CF-A3DB-080036F12502}]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\InprocServer32]
@="C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSCAL.OCX"
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Insertable]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\MiscStatus]
@="0"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\MiscStatus\1]
@="131473"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\ProgID]
@="MSCAL.Calendar.7"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Programmable]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\ToolboxBitmap32]
@="C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSCAL.OCX, 1"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\TypeLib]
@="{8E27C92E-1264-101C-8A2F-040224009C02}"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\Version]
@="7.0"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8E27C92B-1264-101C-8A2F-040224009C02}\VersionIndependentProgID]
@="MSCAL.Calendar"

Open in new window


Copy each snippet into notepad and name them something like MSCAL.reg
Merge them in and try it!
0
 

Author Comment

by:Qualitycomputer
ID: 35516173
Nick67,

Thanks so very much.  I have a couple of remaining questions about your last posts (i.e. adding the reference and creating the .reg files).  Would you prefer to repost your last two suggestions on the new topic thread so that I can assign you some more points?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question