Results 1 to 6 of 6

Thread: Instantiating object of dll in user account. Win Server 2008

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    3

    Instantiating object of dll in user account. Win Server 2008

    Hello all,

    We have a server using Windows Server 2008. It has one admin account and other user accounts. Each user connects to the server using terminal services (using thin clients), which allows them to have their own desktop in the environment. This is what I'm trying to do:

    We have a set of COM dlls that were registered using the admin account. We also have custom VBA code that would utilize the dlls to perform tasks. When we try this on a standalone machine, it works fine. In this particular scenario we can not seem to get the dlls to become available under the user accounts. We tried giving the user complete access to the relevant directories, registering the dlls under the user accounts (gives error), and even changing the user account into an admin account. No luck. Here is the code:

    Option Explicit
    Option Private Module

    Sub test()

    Dim oTemp4 As Object


    Dim Send_String As String
    Dim TOKEN As String
    Dim Diff As Integer
    Dim RETURNED As String

    ChDrive ("C")
    ChDir ("C:\Program Files (x86)\GRC Tools\User\GRC Database Information\GRCToolsDLL")
    Set oTemp4 = CreateObject("grccountry.grccountry")

    oTemp4.Init
    oTemp4.GRCCOUNTRYINIT

    Send_String = "ANZENGRUBERGASSE 4-4" & "|" & "" & "|" & "" & "|" & _
    "WIEN" & "|" & _
    "" & "|" & _
    "1050" & "|" & "DE"

    oTemp4.grccountry Send_String, 15, _
    True, True, True, True, False, False, True, _
    1, TOKEN, Diff, RETURNED

    Debug.Print RETURNED

    oTemp4.GRCCOUNTRYCLOSE

    oTemp4.ReduceMemory

    Set oTemp4 = Nothing

    End Sub

    The error happens at: Set oTemp4 = CreateObject("grccountry.grccountry")

    The error is: Run-time error '-2147467259 (80004005) Unspecified error Automation error

    I did some research, and this error seems to be non-specific. Can someone help? We can't seem to figure out what we're doing wrong. Thanks so much.

  2. #2
    Junior Member
    Join Date
    Sep 2010
    Posts
    16

    Re: Instantiating object of dll in user account. Win Server 2008

    Quote Originally Posted by Dilemma2010 View Post
    Hello all,

    We have a server using Windows Server 2008. It has one admin account and other user accounts. Each user connects to the server using terminal services (using thin clients), which allows them to have their own desktop in the environment. This is what I'm trying to do:

    We have a set of COM dlls that were registered using the admin account. We also have custom VBA code that would utilize the dlls to perform tasks. When we try this on a standalone machine, it works fine. In this particular scenario we can not seem to get the dlls to become available under the user accounts. We tried giving the user complete access to the relevant directories, registering the dlls under the user accounts (gives error), and even changing the user account into an admin account. No luck. Here is the code:

    Option Explicit
    Option Private Module

    Sub test()

    Dim oTemp4 As Object


    Dim Send_String As String
    Dim TOKEN As String
    Dim Diff As Integer
    Dim RETURNED As String

    ChDrive ("C")
    ChDir ("C:\Program Files (x86)\GRC Tools\User\GRC Database Information\GRCToolsDLL")
    Set oTemp4 = CreateObject("grccountry.grccountry")

    oTemp4.Init
    oTemp4.GRCCOUNTRYINIT

    Send_String = "ANZENGRUBERGASSE 4-4" & "|" & "" & "|" & "" & "|" & _
    "WIEN" & "|" & _
    "" & "|" & _
    "1050" & "|" & "DE"

    oTemp4.grccountry Send_String, 15, _
    True, True, True, True, False, False, True, _
    1, TOKEN, Diff, RETURNED

    Debug.Print RETURNED

    oTemp4.GRCCOUNTRYCLOSE

    oTemp4.ReduceMemory

    Set oTemp4 = Nothing

    End Sub

    The error happens at: Set oTemp4 = CreateObject("grccountry.grccountry")

    The error is: Run-time error '-2147467259 (80004005) Unspecified error Automation error

    I did some research, and this error seems to be non-specific. Can someone help? We can't seem to figure out what we're doing wrong. Thanks so much.
    You are using late binding , and that tends to hide the source of errors... Try early binding instead:

    Try setting a reference to "C:\Program Files (x86)\GRC Tools\User\GRC Database Information\GRCToolsDLL\YourDLL'sName.dll" in the Tools/References menu item if you haven't done so already, and use the following code:

    Code:
    Dim oTemp4 As grccountry.grccountry
    ...
    Set oTemp4 = new grccountry.grccountry
    The ChDrive and ChDir statements are irrelevant if all you are doing is trying to point VBA to the DLL.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    3

    Re: Instantiating object of dll in user account. Win Server 2008

    Thank you very much for your response.

    I changed the code to use early binding and I seem to be getting the same error. The error is happening here:

    Code:
    Set oTemp4 = New grccountry.grccountry
    Can it have anything to do with the user account not having access to the dll registration? My original code works fine on the admin account.

  4. #4
    Junior Member
    Join Date
    Sep 2010
    Posts
    16

    Re: Instantiating object of dll in user account. Win Server 2008

    What error are you getting?

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    3

    Re: Instantiating object of dll in user account. Win Server 2008

    Run-time error '-2147467259 (80004005) Unspecified error Automation error

  6. #6
    Junior Member
    Join Date
    Sep 2010
    Posts
    16

    Re: Instantiating object of dll in user account. Win Server 2008

    What is the DLL doing? Perhaps the non-administrator accounts don't have permission to do something the DLL is doing.

    Does the DLL work as a user on a non-terminal-services machine?

    If you are still having problems, and you did not write the DLL, contact the author for help.

Posting Permissions

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



Click Here to Expand Forum to Full Width