Method 'Connection' of object '_CurrentProject' failed

scrapple

New member
Local time
Today, 00:54
Joined
Aug 11, 2010
Messages
2
Help please! I'm using Access 2007 in Windows XP and in need of some advice.

I have a few access VBA programs written in Access 2007 to help me manipulate data that I have in a database. I've used these programs without issue for several months without a problem.

Today I installed Visio 2010 and all of a sudden none of my Access programs will run. As soon as one of my VBA macros tries to execute a sql query the program fails and I get an error message that says:

Run-time error '-214748113 (8000ffff)':
Method 'Connection' of object '_CurrentProject' failed

I get this error message in other databases as well anytime I'm trying to execute a sql query via code.

An example of a type of query I'm running via code:

CurrentProject.Connection.Execute "Update RawData set Subject_Name = 'English' where Subject_Name = 'Reading and Writing'"

This has functioned without fail for several months. I've made no changes except for installing Visio 2010 earlier today.

so the progression is:

- everything is fine, Access 2007 macros work
- install Visio 2010 and Access 2007 macros no longer work

Please help!!!!!! Thanks in advance for any help.
 
You could try CurrentProject.AccessConnection and see if that makes a difference.
But I never use the ADO connection. The Jet DBEngine and DAO are made to work together so I expect you might have fewer troubles in the long run if you use the DAO.Database.Execute() method.
You can return a reference to the default Access Database using CurrentDB, so ...
Code:
CurrentDB.Execute "DELETE FROM tTable WHERE tableID = " & someID, dbFailOnError
Add the dbFailOnError option and a trappable error occurs if the Execute fails for any reason.
Assign the database to a variable if you need to use it a few times ...
Code:
dim dbs as dao.database
set dbs = currentdb
dbs.execute "DELETE FROM tTable"
msgbox dbs.recordsaffected & " records were deleted", vbinformation
HTH
 
Or you may need to uninstall and reinsttpall access.
 
Thanks for the advice! I didn't think of it in my panic last night, but reinstalling Access seems to have done the trick. I hope everything in Visio still works... Thanks!
 

Users who are viewing this thread

Back
Top Bottom