January 14, 2004 at 9:34 am
I'm having a bit of trouble working with SQLDMO in VB.NET.
The Background:
VS.NET 2003 Enterprise Architect, SQLDMO 8.0
I have set a reference to SQLDMO and am using the 'Imports SQLDMO'. The code compiles correctly and starts to execute as desired until I get to the following:
server = New SQLDMO.SQLServer
Or
server = New SQLDMO.SQLServer2
Or
etc...
At this point my Try..Catch block bombs out with the following exception message:
System.Security.Permissions.SecurityPermission
If anyone out there can tell me what I am missing or where I should look, I would really appreciate it. TIA
January 14, 2004 at 3:06 pm
I should have held off on posting this question. I have worked through and found the problem and solved it.
VS.Net does not fully trust network locations. In my case, my code and binary were being stored to a mapped network drive, so when I went to execute the binary, it would fail when it tried to initialize my first SQLDMO object. Solution for this: move the code to a local (C:\, etc) drive.
Solution number 2 (I like this one much better):
Goto Start|Settings|Control Panel|Administrative Tools|Microsoft .NET Framework (or 1.1) Configuration
This should get you set up so that VS.Net will trust your code stored on network storage.
January 22, 2004 at 10:52 am
This will be very helpful to me in the future, I'm sure. Thanks for the posting.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply