Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2006

Tip: Looking for answers? Try searching our database.

Webservice - ODBC - sqlServer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TheMaxx - 07 Dec 2006 08:48 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.