Hi Betty,
What DB are you connecting to and what version?
If you are using MS SQL Server 2008 or above do not use the OLEDB Provider in MDAC, you should change it to MS SQL Native 10 or 11. Requires the Client to be installed on the BOE Server also.
logonDetails.Add("Provider", "SQLOLEDB"); should be
logonDetails.Add("Provider", "SQLNCLI10"); // or 11
MS does not fully support MDAC OLE DB provider with newer versions of their DB Server.
Try setting the logon info with the actual info rather than using variables, sometimes they are not what the should be.
Also, if you are using any un-used data connections delete them first.
Don