I am posting this for the web developer of one of our clients so will take a little time to respond to any questions on it as I get the details from him - please bare with me.
He has connected to the SQL Anywhere 10 database of our shared client from his development machine but cannot make the connection from the web server that will host the site and can't work out why.
The connection string is, (it has < and /> at the start and end but then it would not show on the preview even with <![CDATA[):
add name="sybaseSpaceManager" connectionString="ENG=WebTest;database=webtest;LINKS=tcpip(Host=XX.XX.XX.XX; ServerPort=2639);UID=xxxxxxxx;PWD=xxxxxxxx" providerName="iAnywhere.Data.SQLAnywhere"
The error being returned is:
System.TypeInitializationException: The type initializer for 'iAnywhere.Data.SQLAnywhere.SAConnection' threw an exception. ---> System.Security.SecurityException: Request failed. at iAnywhere.Data.SQLAnywhere.SAConnection..cctor() --- End of inner exception stack trace --- at iAnywhere.Data.SQLAnywhere.SAConnection..ctor(String connectionString) at SYBASE_Default.Page_Load(Object sender, EventArgs e) in E:\Domains\v\vikingselfstorage.co.uk\user\htdocs\SYBASE\Default.aspx.vb:line 21
Apart from being on different networks in different locations the only real difference we can see in terms of the systems is that on his development machine he has Sybase 10 installed. Would it need to be on the server as well? I am being told that the server has all the pre-requesites for Sybase ADO connectivity but I can't check that as I don't even know what that means.
The server hosts have apparently done some tests and have said:
"Our engineers have checked your script and it appears that the connection string is attempting to do something that is in violation of the trust environment. We recommend that you contact Sybase for assistance."
To me that smacks of "we don't know and made something up that sounds like it isn't at our end". As we know the process works from his development machine then it would seem to me that the issue is at the server not on the Sybase end.
Anyone got any experience or words of wisdom for things to try, test or add onto the web server, (we can't install a full SQL Anywhere as it is a shared server).
Thanks in advance. Alasdair
asked 20 Oct '15, 08:17
As part of the instantiation of the SQL Anywhere ADO.NET assembly, we will attempt to extract a native DLL (dbdata10.dll on a SQL Anywhere 10 client) for communication to SQL Anywhere from the managed code to unmanaged code via PInvoke (see the documentation). It would appear from the error that you are not currently allowed in the ASP.NET context to do that, due to the server's security restrictions.
There is an article from Microsoft to adjust the security settings for your ASP.NET application which may help: https://support.microsoft.com/en-us/kb/555466
answered 20 Oct '15, 17:38