When I run this connection, I get a security error.
String connectStr = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"User Id=USER; Password=PASS;" +
@"Data Source=\\SERVER\DIRECTORY\Data.mdb;" +
@"Jet OLEDB:System
Database=\\SERVER\DIRECTORY\SYSTEM.mdw";
connection = new OleDbConnection(connectStr);
connection.Open(); // <=== error!
the error:
Request for the permission of type 'System.Data.OleDb.OleDbPermission,
System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=TOKEN'
failed.
(Keep in mind that anything in all caps here is my own edit, for
security reasons. I assure you, syntax within those areas is correct.)
I've attempted several variations of this connection string, including
Mode = Share Deny None, Persist Security Info = false, and so on. The
database I'm trying to hit is on a server in my network. There is no
password on the database, but my account does have one (included where
PASS is).
I've successfully set up connections within Access forms using these
same connection strings. Why would I have security issues within
VS.NET 2k5?