Re: Cannot connect via Web Application...



I think your problem has something to do with permission as the error
indicates. If you are writing an ASP.Net web page then your web application
is running as the ASPUSER Windows user and chances are this use does not
have permissions to connect to the database. When you run as a Windows
application you run as you and you probably have admin permissions on the
box which gives you SA permissions in the database so you can do whatever
you want. Confirm that you are running as ASPUSER and then create a login
and user for it in SQL Server.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"IV" <Imtiaz.Vohra@xxxxxxxxxxx> wrote in message
news:1168476873.734347.313800@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am using SQLServer 2000, Visual Studio 2003, C#.

I am writing a web part which requires me to connect to a local sql
database.

I wrote a class which handles the connection and reading of the table.

When I try to call .Open on the connection, it fails, the exception is
something to do with permission.

I used the same class to connect with a console application and a
windows application, and it works fine. I am able to connect and read
the table.

Can anyone shed some light on what is the difference between
connecting/accessing to a database via Web Application as opposed to a
Non-Web App.

TIA



.



Relevant Pages

  • Re: ActiveConnection works at one host but not at another
    ... I'd set the permissions for the .mdb file, ... I used a connection string because I'd read some forum ... Access 2002 database. ... I notice that instead of an explicit connection object, ...
    (microsoft.public.inetserver.asp.db)
  • RE: Jet database access problem from web service
    ... "Sonya" wrote: ... > I have trouble connecting to Access database from my web service. ... > normal user who has full permissions over Data directory; ... > I also tried an Odbc connection with with the follwoing string: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: (Newbie)Application Roles
    ... level: the database itself. ... SQL Server accommodates these needs through the use of application ... the user's connection through a specific application. ... the connection permanently loses all permissions applied to ...
    (microsoft.public.sqlserver.security)
  • Re: Connection problem with Access
    ... If you don't need the Word object to connect, remove the relevant code as it's probably a distraction. ... However, I'm not sure you can manually connect Word to an Access data source that has a securit database, unless the Admin username and a blank password will give you access to the table you need. ... I think you'd probably have to do it the way I suggested, at lleast for an OLE DB connection. ... permissions can be relatively fine-grained, ...
    (microsoft.public.word.mailmerge.fields)
  • Re: List Users Permissions down to table.column action
    ... THIS STORED PROCEDURE GENERATES COMMANDS ... -- FIXED PROBLEMS WITH STATEMENT LEVEL PERMISSIONS GRANTING. ... -- CREATE TABLE TO HOLD LIST OF USERS IN CURRENT DATABASE ... -- GRANT USER ACCESS TO SERVER ROLES ...
    (microsoft.public.sqlserver.security)

Loading