Take a look at this error first:
An error occurred accessing a data source.
An entry has been added to the Windows event log of the server.
Log ID:5566
Does it look familiar? No? How about this one?

I assume that you love it because without these errors we could
never have a job as consultant. I got this error when I deployed an InfoPath
2007 form to MOSS 2007 forms server. There was nothing wrong with the form but
it was getting the user information from MOSS profile to have some part of the
form pre-populated. First of all when I checked the application log on the front
end server I found nothing. Considering the farm installation I could find the
error on the server box that was hosting the SharePoint Central
Administration service. Here is the error in the application log:
A runtime exception was detected. Details follow.
Message: Access Denied! Only site admin can access Data Source object from user
profile DB.
Techinal Details:
System.UnauthorizedAccessException: Access Denied! Only site admin can access
Data Source object from user profile DB.
at Microsoft.Office.Server.UserProfiles.SRPSite.AdminCheck(String message)
at
Microsoft.Office.Server.UserProfiles.DataSource._LoadDataSourceDef(IDataRecord
rec)
at Microsoft.Office.Server.UserProfiles.DataSource._LoadDataSourceDef(String
strDSName)
at Microsoft.Office.Server.UserProfiles.DataSource..ctor(SRPSite site, Boolean
fAllowEveryoneRead)
at Microsoft.Office.Server.UserProfiles.DataSource..ctor(SRPSite site)
at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager.GetDataSource()
at Microsoft.Office.Server.UserProfiles.BDCConnector.RefreshConfiguration(String
sspName)
For more information, see Help and Support Center at
It seems that the forms server is trying to access to Profile
Services on MOSS and it is complaining that Only Site Admin can do that. Here
was the tricky part. On the top of the page I could see the spadmin login
account. This account was site admin for MOSS, SharePoint Central administration
and also Shared Services Provider site. So what else is missing?

The answer is here:
Go to SharePoint Central administration --> Application Management -->
Authentication Providers. Then select the default zone. Make sure the right
Web Application is selected on the top of the page. Clear the checkbox for
the anonymous access. And now you can run your form with the forms server
happily ever after.
Important point:
When you are using Forms Server with MOSS the site security is not applied to
the underlying services. It means even if your MOSS website requires
authentication, if Provider is anonymous enabled forms services uses anonymous
login for the external access, because it looks at the provider, not the site
that is hosting the form. It took me a long time to find it out because I had
the impression that Forms Server impersonates the user login information and
when I see the user ID on the top of my SharePoint page, this is not anonymous
call. I was wrong.
With special thanks to Infusion SharePoint Technical team
that gave me wonderful guides to resolve this issue.
Cheers
Alireza