I need to access ODBC from remote computer, if there's a better way other
than WebService please let me know.
So, i am doing web service which connects on ODBC, which connects to
SqlServer 2000 (Windows auth.)
First error was:
Login failed for user 'MyComputerNmae\ASPNET'.
Then i unchecked "Anonymous acces" from IIS for this webservice
I added to web.config of webService:
<identity impersonate="true"
userName="DOMAIN\username"
password="pwd"/>
When i call method from browser directly to web service i get expected
results.
When trying from application that uses WebServices i get an error:
"The request failed with HTTP status 401: Access Denied."
What can cause this error?
p.s. call from webservice looks like this:
OdbcDataAdapter adapter = new OdbcDataAdapter(query, odbcConnectionString);
DataSet ds = new DataSet();
adapter.Fill(ds);
return ds;
John Saunders - 07 Dec 2006 12:54 GMT
>I need to access ODBC from remote computer, if there's a better way other
>than WebService please let me know.
I would think about using .NET Remoting instead of Web Services. Web
Services are meant to be platform-independant, and there are aspects to
their use which make it difficult to use .NET-specific features. If you
don't need the platform-independence, I believe it's best to do without it.
As to your specific problem, I'd need to see the client code which calls the
web service. In particular, does the client code set the Credentials on the
web service proxy? Also, if you want to use Windows Authentication to the
web service, I believe you'll have to make sure that Anonymous access is
turned off in IIS.
Finally, out of curiosity, why ODBC instead of using the Sql Server client
classes? I'm referring to SqlConnection etc.
John