P
Pete
I have a problem involving type library versions I hope somebody can help me
with.
I develop applications using Access 2003 running on Windows XP Professional.
The finished applications are published to a Windows 2003 Server where they
run (users connect via Citrix).
I have recently added some functionality that uses the Active Directory
Services type library (activeds.tlb; activeds.dll). However, whilst this
works fine on my PC it fails on the server. I noticed that the dll versions
differ and are newer on the server – re-referencing the dll and building the
mde on the server fixes this, but it then will not work on my PC.
My first attempt at a solution was to copy the server version of the
activeds.tlb; and activeds.dll files to my PC, but they are protected by
Windows System File protection so I haven’t found a way to do this.
Second thought was to use ‘late binding’, but as far as I am aware the code
I am using is already doing this?! See code below.
Any help appreciated.
Regards
Peter
Option Compare Database
Option Explicit
'*** Get Current Users Login Name ***
Private Declare Function GetUserNameEx Lib "secur32.dll" Alias
"GetUserNameExA" (ByVal NameFormat As Long, ByVal lpNameBuffer As String,
ByRef nSize As Long) As Long
Public Function GetUserInfo()
Dim sBuffer As String, Ret As Long, strAlias As String
sBuffer = String$(256, 0)
Ret = Len(sBuffer)
If GetUserNameEx(3, sBuffer, Ret) <> 0 Then
strAlias = Left$(sBuffer, Ret)
End If
'*** Lookup Details In Active Directory ***
Dim oRootDSE As IADs
Dim varDomainNC As Variant
Dim oUser As IADsUser
Set oRootDSE = GetObject("LDAP://RootDSE")
varDomainNC = oRootDSE.Get("defaultNamingContext")
Set oUser = GetObject("LDAP://CN=" & strAlias & ",CN=Users," &
varDomainNC)
strFirstName = oUser.Get("FirstName")
strLastName = oUser.Get("LastName")
End Function
with.
I develop applications using Access 2003 running on Windows XP Professional.
The finished applications are published to a Windows 2003 Server where they
run (users connect via Citrix).
I have recently added some functionality that uses the Active Directory
Services type library (activeds.tlb; activeds.dll). However, whilst this
works fine on my PC it fails on the server. I noticed that the dll versions
differ and are newer on the server – re-referencing the dll and building the
mde on the server fixes this, but it then will not work on my PC.
My first attempt at a solution was to copy the server version of the
activeds.tlb; and activeds.dll files to my PC, but they are protected by
Windows System File protection so I haven’t found a way to do this.
Second thought was to use ‘late binding’, but as far as I am aware the code
I am using is already doing this?! See code below.
Any help appreciated.
Regards
Peter
Option Compare Database
Option Explicit
'*** Get Current Users Login Name ***
Private Declare Function GetUserNameEx Lib "secur32.dll" Alias
"GetUserNameExA" (ByVal NameFormat As Long, ByVal lpNameBuffer As String,
ByRef nSize As Long) As Long
Public Function GetUserInfo()
Dim sBuffer As String, Ret As Long, strAlias As String
sBuffer = String$(256, 0)
Ret = Len(sBuffer)
If GetUserNameEx(3, sBuffer, Ret) <> 0 Then
strAlias = Left$(sBuffer, Ret)
End If
'*** Lookup Details In Active Directory ***
Dim oRootDSE As IADs
Dim varDomainNC As Variant
Dim oUser As IADsUser
Set oRootDSE = GetObject("LDAP://RootDSE")
varDomainNC = oRootDSE.Get("defaultNamingContext")
Set oUser = GetObject("LDAP://CN=" & strAlias & ",CN=Users," &
varDomainNC)
strFirstName = oUser.Get("FirstName")
strLastName = oUser.Get("LastName")
End Function