Method 'Connection' of object '_CurrentProject' failed on any form edit preceeded by "Automation Error The specified procedure could not be found." But im not automating anything! I do have code that writes reads variables from the table i just edited in the "on close" code piece though which is the trigger for the error:
On Error GoTo ErrorHandler
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim strSql As String
Dim strCurrentProjectPath As String
blnCurrentPathUsed = False 'keep track of wether attempts to use the current path were used and if they failed
strCurrentProjectPath = CurrentProject.Path & "\"
strSql = "SELECT * FROM tbllkupProgramOptions WHERE MachineName = """ & fOSMachineName & """"
rs.Open strSql, CurrentProject.Connection, adOpenForwardOnly, adLockPessimistic
If rs.EOF = True Then ' No Options for this computer so Add Defaults
This is the problem i get in a 2010 project after several years of using this project, it started out as 2000 then 2003 then 2007 then 2010 and it quit working recently but ONLY on .accde project packages. I can run the accdb with no issues at all. I have read the first 3 pages of google on this an im actually at a loss. I have created a new database, imported my forms and code over. I have compacted, repaired. I have removed all references and readded. I have done everything i know how. Now for the wierdest part, 100% of this problem i have researched happens upon code to do with recordsets usually dao vs the new access database engine reference. Well my error happens on every form in which i try to write via ADO. It happens on ACCDE projects on xp xp3 and win 7.
Currently my references are shown in the screenshot, I have also tried switching ado and adox 6.0 to 2.8 with no success either. I have developed with access for over 10 years and I am actually tapping out. I repaired my dev machine, I uninstalled reinstalled my dev machine, I even installed a fresh copy of 2010 on another desktop and brought my files over and compiled a new accde and created a package. That package when installed on the laptop thats giving me trouble has the same error! I have also opened mssaccess with the /decompile option on my code. I can't seem to find the common denominator I literally have done everything i know how to. The database i use is in a backend / frontend format and uses dao code to connect the underlying linked tables (but its worked for a long time, and I thought DAO was depreciated with the new database engine object and all code still worked) Please help experts!