I created a function in SQL Server 2008.
I can run both of these statements in SSMS without errors:
SELECT * FROM myFunction(myParam1,'myParam2');
SELECT * FROM dbo.myFunction(myParam,'myParam2');
But this in VBA gives a 'Invalid Object' error on 'myFunction' when executing the query:
Set db = New adodb.Connection
db.Open "Provider=SQLNCLI10;Data Source=aaaaa;Initial Catalog=db_ferm;Trusted_Connection=yes;"
Sql = "SELECT * FROM myFunction(" & theParam & ",'" & theParam2 & "') "
Set GetReport = db.Execute(Sql)
These 'Invalid Object Name' errors suddenly started showing up today. Even now in SSMS, I will get them occasionally and have to reset the Intellisense Cache.
Ideas?