Set con = application.currentproject.connection error
I have an Access 2000 database I use on a number of Windows 2000 and NT machines. This database works well.
I took this database and copied it to another machine which has Access 2000, Access XP and Windows XP operating system. Whenever I try to startup the switchboard, I get an error which when debugged points to this line in the switchboard code:
Set con = application.currentproject.connection
I checked the references and they seem to be identical on both the W2k machines and the XP machine:
- Visual Basic for Applications
- Microsoft Access 9.0 Object Library
- OLE Automation
- Microsoft ActiveX Data Objects 2.1 Library
If you create a project from scratch on the machine that is causing problems - go to the references section and see if the ado reference is available. If it is, try a test. If it fails, re-register it ( you can also reinstall with the latest mdac from ms web site).
Thank you for all your help. Through your comments I was able to get Access and VBA to work again. Seems there were a number of components that weren't properly registered or missing dependency files on the computer. I suspect that two recent Service Pack updates (one for Windows XP and one for Office XP) did not properly install all files in the locations needed.
Solution: I used a tool from 4developers.com called COM Explorer which browses the computer (registry) for registered ActiveX, dll and exe components and reports on "misbehaved" ones. I found that many of my ADO, DAO, OLE and msadc components were missing files. In searching the harddrive, I found most of them in a folder in the
%WINDIR%ServicePackFiles\i386 folder. I copied the files where COM Explorer said they should be (or by default in the %WINDIR%System32 directory).
I may not have everything where it goes properly but it works now! I'm going to contact MS to inquire about the SP problem.
I would either reinstall the current version of mdac or install the latest version of mdac - only because fixing every file that has not been registered properly or is damaged (plus dependencies) is a nightmare in a package as large as mdac - even with a tool. This will take care of any files that may cause you problems in the future.