Welcome to Forums Sign in | Join | Help | Forums
in Search


Query Set - Object variable or With block variable not set error

Last post 01-09-2007 5:29 PM by Chris Thomson. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-06-2006 8:01 PM

    • Chris Thomson
    • Top 500 Contributor
    • Posts 37
    • Organization: Victoria University of Wellington
    • Products:  The Raiser's Edge

    Query Set - Object variable or With block variable not set error

    I am getting “Object variable or With block variable not set” error message when trying to open a query set (querySet.OpenQuerySet()) .in C# .Net ver 1.1 when running under IIS. I’ve narrowed this problem down to IIS., as I get the Object variable etc message whenever I try and open a query set from within IIS. This occurs within my main app (dll) or if I create a small standalone executable (with the code below) and execute that as a shell routine from my main app (running in IIS). Code snippet as follows: public void testQuery() { // Put user code to initialize the page here REAPI reAPI = new REAPI(); reAPI.Init("", "Supervisor", "Admin" ,50 , "", REDOTNetAPI.AppMode.amServer); reAPI.SignOutOnTerminate = true; REDOTNetAPI.IBBSessionContext sessionContext = reAPI.SessionContext; CQueryObjectClass query = new CQueryObjectClass(); query.Init(ref sessionContext); query.LoadByField (REDOTNetAPI.bbQueryUniqueFields.uf_QUERY_NAME, "All Current Members"); CQuerySet querySet = query.QuerySet; querySet.OpenQuerySet(); querySet.CloseDown(); query.CloseDown(); } At this stage any suggestion would be gratefully received.
  • 07-07-2006 9:43 AM In reply to

    • David Zeidman
    • Top 25 Contributor
    • User Since: 2002
    • Posts 326
    • Organization: Zeidman Development
    • Products:  Blackbaud Direct Marketing, Blackbaud Enterprise CRM, The Information Edge, The Raiser's Edge

    Query Set - Object variable or With block variable not set error

    Are you certain that the session context object has been initialized. Try seeing if you can get the userid from it sessioncontext.CurrentUserID. The reason I say this is that when I was working with VBA DLLs I found that the sessioncontext was not retained in between calls. I am not sure that IIS is behaving in the same way but it is worth a try. I converted your code to VB and it works fine from within a VB6 project. David Zeidman Development http://www.zeidman.info
    David Zeidman
    Zeidman Development
    http://www.zeidman.info

    Check out my RE API blog
    http://www.re-decoded.com
  • 01-09-2007 5:29 PM In reply to

    • Chris Thomson
    • Top 500 Contributor
    • Posts 37
    • Organization: Victoria University of Wellington
    • Products:  The Raiser's Edge

    Query Set - Object variable or With block variable not set error

    It was a permissions issue and was solved when I solved a seperate problem. Solution to that problem was as follows: What you need to do is as per KB (BB121222) . Specifically when you are applying the Read and Execute permissions to the folders specified make sure you apply it to the folder and its child objects. Specifically: locate the folder in windows explorer Right Click and Select Properties ! Security Select Add and enter ASPNET Select OK and then Select Advanced on the properties dialog box Tick the check box “Replace permissions on all child objects …. Select Apply …
Page 1 of 1 (3 items)