At forum entry http://forums.asp.net/t/1374832.aspx?Security+Exception+Medium+Trust+w+OleDbPermission+Go+Daddy+Shared+Server the original poster reported that he was getting the security exception from using OLEDB provider to connect to an access file. Someone told him to use an SQL server database, (which is not really an answer as that is not always possbile.) He reported,
However, it turned out that my security exception was the result of my repeater utilizing reflection. I found a workaround and everything works fine now.
Unfortunately he never provided an example of the work around he used. Looking at the source code he originally provided I don't see what what kind of workaround he could have come up with.
Now we are getting the same issue in our .Net 4.5 Framework Server set to High level Trust because we are using an OLEDB provider. Our experiments using modified trust level files as specified by Microsoft to customize the trust level have not worked so well on our file I/O Medium Trust level permission issue. However they were successful with the MS provided customization for OLEDB connections However, since we can't use a customized trust level to fix our other issue, I would be interested in any thoughts on what this workaround could possible be to defeat the restrictions on the use of OLEDB providers.