If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Set con = application.currentproject.connection error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Oct 2002
Location: ames, ia
Posts: 4
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

Any help? Thanks...Fred.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Feb 2002
Posts: 2,232
What is the error ? Are you sure that the activex data objects library exists on the new machine ? Have you tried creating a connection from scratch ?
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Oct 2002
Location: ames, ia
Posts: 4
The error reads:

Run-time error '-2147024770 (8007007e)':

Method 'Connection' of object '_CurrentProject' failed


I got the same result by creating a new database with 1 table, 1 form and 1 report and then creating a switchboard for the form and report to open.

Same error, same line in debug.

Also, I tried stepping through the code using F8 and it seems to be disabled.
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Feb 2002
Posts: 2,232
This is either a dll registration problem/corruption or you have references in your access project to items that do not exist on the new machine.
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Oct 2002
Location: ames, ia
Posts: 4
I kind of suspected that. After I posted my reply, I took the database to another machine running XP with Access XP and it worked fine.

Any idea where I start to correct this problem? The machine is a dual-boot XP and W2K. The W2K side has Office 2000 and the XP side has only Access 2000 with a full Office XP install.

Thank you for your replies!
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Feb 2002
Posts: 2,232
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).
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: Oct 2002
Location: ames, ia
Posts: 4
Talking Fixed - at least it works

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.

Again, thank you for all your help!
Reply With Quote
  #8 (permalink)  
Old
Registered User
 
Join Date: Feb 2002
Posts: 2,232
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.

Good luck.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On