Unanswered: Method Connection of ADODB Object '_CurrentProject' failed
I have a Microsoft Access application that worked fine until I installed a local copy of Microsoft SQL Server 2005 on my PC. After that when I run the code below, I get the error in the title of this post (Method Connection of Object '_CurrentProject' failed ):
Dim cnn As ADODB.Connection, rst As New ADODB.Recordset
Set cnn = CurrentProject.Connection
I thought that the current project might be the SQL database rather than the Access database, but when I tested that theory with the code below:
Dim stName as String
stName = CurrentProject.Name
The name of the current project is the Access data file. Therefore, I guess that the local SQL connect must be conflicting. One other thing is that I have had SQL Server Management Studio and a connection to an SQL Server for some time and it never interferred with ADODB code. Any help is greatly appreciated.
One other thing, I found a similar question posted in this forum in 2002, but could not find where anyone ever answered the question.