Webservice - ODBC - sqlServer

Discussion in 'ASP .Net Web Services' started by TheMaxx, Dec 7, 2006.

  1. TheMaxx

    TheMaxx Guest

    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;
    TheMaxx, Dec 7, 2006
    #1
    1. Advertising

  2. "TheMaxx" <> wrote in message
    news:el8k3v$2p$...
    >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
    John Saunders, Dec 7, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. batista
    Replies:
    1
    Views:
    894
    Laurent Bugnion
    Jan 26, 2006
  2. TheMaxx

    Webservice - ODBC - sqlServer (2)

    TheMaxx, Dec 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    540
    TheMaxx
    Dec 7, 2006
  3. =?Utf-8?B?SmVmZnJleQ==?=

    Upgrading ASP w/SQLserver 2000 to ASP.NET w/ SQLserver 2005

    =?Utf-8?B?SmVmZnJleQ==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    464
    sloan
    Apr 27, 2007
  4. G
    Replies:
    2
    Views:
    415
    Arne Vajhøj
    Oct 12, 2008
  5. Wes Gamble
    Replies:
    1
    Views:
    151
    Gerardo Santana Gómez Garrido
    Apr 5, 2006
Loading...

Share This Page