Re: No results from query in some contexts

From: Andrew J. Kelly (sqlmvpnooospam_at_shadhawk.com)
Date: 11/25/05

  • Next message: Iain: "Re: No results from query in some contexts"
    Date: Thu, 24 Nov 2005 20:09:22 -0500
    
    

    It must be a permissions thing with the sp and the account you are
    connecting with. Try giving execute permission directly to that account and
    maybe even read permission on that table as well. Then use profiler to
    ensure you are connecting and executing that proc as you expect. Other than
    that I don't see why you would be getting these results.

    -- 
    Andrew J. Kelly  SQL MVP
    "Iain" <Iain@idclTAKEAWAY.co.uk> wrote in message 
    news:15gqdfdppnoif.lc2gfbh9uhun.dlg@40tude.net...
    > On Thu, 24 Nov 2005 09:49:19 -0500, Andrew J. Kelly wrote:
    >
    >> Can you at least show us the code?  My guess would be one of two things.
    >> Either you are connecting to a different db or the ASP app is not 
    >> formatting
    >> the query properly.  More specifically it may be treating the value in 
    >> the
    >> WHERE clause as the wrong datatype.  But without seeing your query and 
    >> the
    >> DDL for the table we can make guesses all day long.
    >
    > Thanks for your replies!
    >
    > A sample stored procedure is
    >
    > ALTER PROCEDURE dbo.Test
    > AS
    > SET NOCOUNT ON
    > select * from aspnet_Users
    > RETURN
    >
    > (I have FormsAuthentication running and the asphet_Users database has 
    > about
    > half a dozen records in).
    >
    > If I execute this sproc from SQL Server Management studio connected to the
    > database, I get my half dozen records back.
    >
    > If I execute the same procedure from within visual studio 2005 I get
    >
    > ApplicationId                          UserId
    > UserName
    > LoweredUserName
    > MobileAlias      IsAnonymous LastActivityDate
    > ---- --- -- 
    > No rows affected.
    > (1 row(s) returned)
    > @RETURN_VALUE = 0
    >
    > ( I don't understand the one row returned, though!)
    >
    > If I open up the table in visual studio 2005 I see the records.
    >
    > If run the query in VS 2005 as a new query (select * from aspnet_Users) I
    > get the results I expect.
    >
    > In both cases the connections are with Windows Authentication.
    >
    > If I run my app and step through the code which calls one of the sprocs
    > (not this one a more complex one, but one which works in the Management
    > studio) I see that it returns no entries in the result set.
    >
    > I do not see any errors being raised at any point - it's as ifhte result
    > set from a sproc just gets lost in some cases!
    >
    > Having said all that the application is accessing some tables through
    > sprocs because the asp.net forms authentication is working, which means it
    > is getting data from the tables made by the aspnet membership wizards.
    >
    > What is confusing me is that I get no data back.  If i got an exception
    > because of security I'd see what to do!
    >
    >
    > Iain
    > -- 
    > Iain Downs (DirectShow MVP)
    > Commercial Software Therapist
    > www.idcl.co.uk 
    

  • Next message: Iain: "Re: No results from query in some contexts"

    Relevant Pages

    • Re: Error spawning cl.exe
      ... How do i check if my code has the permission to execute cl.exe? ... I am doing all these through the Visual Studio 2003 IDE. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Asynchronous Threading Issue
      ... callbacks is that if I use a callback function it will execute on a ... if I use a callback function ... I want to call BeginConnect so that I try to connect without holding up ... but if there's an error connecting I want to ...
      (microsoft.public.dotnet.general)
    • Re: All Quantifier
      ... The working code: ... :- dynamic done/1. ... % black_edge and so black_conn connecting two processes ... % Now A shall also be required in order to execute C: ...
      (comp.lang.prolog)
    • Re: No results from query in some contexts
      ... > Either you are connecting to a different db or the ASP app is not formatting ... If I execute this sproc from SQL Server Management studio connected to the ... If I open up the table in visual studio 2005 I see the records. ...
      (microsoft.public.sqlserver.security)
    • Re: Networking - Access denied to shared folders
      ... Vista Permission IssuesCan I assume the external drive used to be connecting to other computer and you just re-connect it the the Vista? ... When I click "View Network Computers" from the cable connected laptop, ...
      (microsoft.public.windowsxp.network_web)