Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 15th, 2007, 01:46 PM
Authorized User
 
Join Date: Dec 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to FalseParadigm
Default OleDbPermission Exception

Product: VB.Net 2005
OS: Windows XP, Windows Server 2000

I have written a small program that pulls data from an Access database. The build works fine on my system (WinXP), but fails to work on any shared drive on our network (Win 2000 Server). When I run it, I throw the following exception.

---------------------
System.Security.SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=meutral, PublicKeyToken=b77a5c561934e089 failed.

at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand, StackCrawlMark&stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at System.Data.Commom.DbConnectionOptions.DemandPermi ssion()
at System.Data.OleDb.OleDbConnection.PermissionDemand ()
at System.Data.OleDb.OleDbConnectionFactory.Permissio nDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()

The action that failed was:
Demand
The type of the first permission that failed was:
System.Data.OleDb.OleDbPermission
The Zone f the assembly that failed was:
Intranet
-------------------------------

These are the steps I have taken to solve the problem:

First, I updated the server box to .net framework 2.0. I discovered that this did not install the .NET Framework 2.0 Configuration tool. From a local machine, I was able to discover that the global permissions were in the enterprisesec.config file in the framework folder. There was no such file on the server, though I was able to confirm that the 2.0 framework was installed (other software not requiring an oledb connection written with vb.net 2005 worked perfectly). I uninstalled and reinstalled the .net framework 2.0. This did not solve the problem

I read from Microsoft that the Configuration tool is available in the SDK. This was downloaded and installed on the server. Again - no Configuration tool, no enterprisesec.config file. The SDK was uninstalled and reinstalled. This also did not solve the problem.

I am looking for help on the following:
A) Is there something special about Win 2000 Server that handles the .Net Framework differently than XP?
B) Will writing my own enterprisesec.config for the server work? Will anything adverse happen if I do so?
C) Ultimately, I want this program to work on the shared drive. If I'm not able to find a solution to A and B, is it possible to include something in my code or app.config file to force permissions for OleDb on the server?

If this would be better asked in a programming forum, please let me know.
Any help would be greatly appreciated.
__________________
<hr noshade size=\"1\">\"We do things my way, or the Hemingway...\"





Similar Threads
Thread Thread Starter Forum Replies Last Post
COM Exception muralidharan.d VS.NET 2002/2003 0 August 7th, 2007 02:49 PM
OleDbPermission Exception FalseParadigm .NET Framework 2.0 0 May 15th, 2007 01:44 PM
Exception when transforming using ksskumar XSLT 1 October 10th, 2006 02:33 AM
Exception Ochi C# 1 January 15th, 2006 11:38 PM
Security exception akibaMaila VB.NET 2002/2003 Basics 3 June 30th, 2005 01:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.