Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2003
    Posts
    24

    Unanswered: permission denied : cant create object

    Hi All,

    I have a VB program(dll) that is creating an access object using
    CreatObject(Access.Application). The VB prgram runs fine from the DOS command prompt. But when I scheduled it to run as SQL server job(Via Sql Server 2000 Enterprie Manager) I got error in the log file(generated by VB program) :
    =====
    Can't create object Access.Application
    Permission denied.
    ========

    Please help me what permission do I have to have to run the vb prgram via sql server.

    Note : Both SQL Server and Agent services are running as a domain user that have Administrator priv to the local machine.
    I have also tried to run these services as a local user(with admin priv). But same results.

    I would be obliged if you guys help me with your expert ideas.
    Thanks in advance.

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Who is the owner of the job and is the owner a sa in sql server ? Have you tried running the vb app as a windows scheduled task ?

  3. #3
    Join Date
    Nov 2003
    Posts
    24
    Originally posted by rnealejr
    Who is the owner of the job and is the owner a sa in sql server ? Have you tried running the vb app as a windows scheduled task ?
    Yes, SA is the owner of the job. And code is running fine as an NT scheduled job.

  4. #4
    Join Date
    Nov 2003
    Posts
    24
    Did any one get a chance to look at my problem? Actually I am stuck on this problem for last many days but couldn't figure it out.

  5. #5
    Join Date
    Feb 2002
    Posts
    2,232
    When you run the vb app and it runs successfully do you run it on your local machine or on the machine that contains sql server ? Does the reference that you use in the vb project for access exist on the machine that has sql server ? Is your vb application an exe or dll (I know you mention dll originally but I wanted to clarify) ? Have you tried creating a vb app that references any other object ?

  6. #6
    Join Date
    Feb 2002
    Posts
    2,232
    There might be an alternative - what is the vb app doing ?

  7. #7
    Join Date
    Nov 2003
    Posts
    24
    Actually I have one VB exe that is calling another VB dll and the object reference (access.application) is being made in the dll. I ran the job successfuly on the same server where I keep SQL server database. Also the object is created on the same machine. And I have installed Access too on that machine.

    I am wondering if we need some special priviliges for just for SQL Server Agent.

  8. #8
    Join Date
    Nov 2003
    Posts
    24
    Originally posted by rnealejr
    There might be an alternative - what is the vb app doing ?
    The problem is this is a production job and running fine on sql server 6.5 under sql executive. So i can't look for the alternate.

  9. #9
    Join Date
    Nov 2003
    Posts
    24
    Hey Guys,

    I found the solution. I was using the same account to start sql server and sql agent services as with I logged on Windows(and that account was under local admin group). But when I selected "system account(instaed of this account)" the job ran fine.

    Theoratically both account are same but don't know why the job dodsnt work when I mention user id explicitly.

    Can anyone explain??? (or this is just a matter of STUPID technology).

    ???????????????

  10. #10
    Join Date
    Feb 2002
    Posts
    2,232
    Thanks for posting the solution.

    Was this account the same account that you used to run the application in the windows scheduler you mentioned earlier - if not try it to see if you have the same problem ?

  11. #11
    Join Date
    Nov 2003
    Posts
    24
    Originally posted by rnealejr
    Thanks for posting the solution.

    Was this account the same account that you used to run the application in the windows scheduler you mentioned earlier - if not try it to see if you have the same problem ?
    The account to run sql server /Sql agent services, to log on the windows and to run the job from NT scheduler are the SAME.

    That's why I am wondering what did it make difefrence when I selected "sys tem accont" instaed of giving the account under "this account"??????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •