locked
Object variable or With block variable not set (Error 91) RRS feed

Answers

  • problem solved~~!!!! ODBC source is missing!!! Thanks every body !!!
    • Marked as answer by sakurai_db Friday, January 30, 2015 9:49 AM
    Friday, January 30, 2015 9:49 AM

All replies

  • Do you have the source code? The error itself is a nullreference error. It means the code is trying to use some object to access a property of method of that object, but the object is currently null so it fails. The fact that it runs different when you run as a domain admin versus local admin could mean that it does something via a network location or resource, and when running as a domain admin, it has access to that resource and succeeds, but the local admin doesn't have access to the needed resource, and the code doesn't check to see if the object is null before using it. If you don't have the source code, then it will be difficult to fix, other than giving the local admin the ability to access whatever it is the program is looking to access.


    Matt Kleinwaks - MSMVP MSDN Forums Moderator - www.zerosandtheone.com

    • Proposed as answer by Reed KimbleMVP Wednesday, January 28, 2015 6:48 PM
    Wednesday, January 28, 2015 3:47 PM
  • Hi,

     Are you using VB6?  This error seems to bring up a lot in a google search for "Object variable or With block variable not set (Error 91)" and it seems to be about VB6.

    Object variable or With block variable not set (Error 91)

     If it is then you should ask on a forum that still supports VB6 like below.

    VBForums: Visual Basic 6 and Earlier


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Wednesday, January 28, 2015 5:48 PM
    Wednesday, January 28, 2015 3:53 PM
  • Yes it is either going to be VB6 or VBA, but I think the answer is still the same regardless of it being .NET or not.

    Matt Kleinwaks - MSMVP MSDN Forums Moderator - www.zerosandtheone.com

    Wednesday, January 28, 2015 4:16 PM
  • It's rather obvious there is a permissions/security issue when creating a certain object. Can you identify the code where the exception occurs?

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Wednesday, January 28, 2015 4:52 PM
  • Hello Sakura,

    Because this is a developer forum it makes no sense trying to get help around it not running of your program.

    The code is what makes it run.

    Probably their is a bug in your program or it was intended to be run by a domain administrator and is the cause that it fails if not simply accepted as the way to prevent it to be used by other users.

    However, you need the help from the owner of the program (and with that, the one who ordered to make it)


    Success
    Cor

    • Proposed as answer by Reed KimbleMVP Wednesday, January 28, 2015 6:48 PM
    Wednesday, January 28, 2015 6:32 PM
  • problem solved~~!!!! ODBC source is missing!!! Thanks every body !!!
    • Marked as answer by sakurai_db Friday, January 30, 2015 9:49 AM
    Friday, January 30, 2015 9:49 AM