Results 1 to 2 of 2

Thread: Automation error The Authentication service unknown

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Posts
    65

    Automation error The Authentication service unknown

    Hi,

    I built a client/server application that have a server component (authorization.dll). When I deloyed the server component on COM+ on windows 2000 server OS and client on windows 2000 (on the same domain). It worked well.

    But when I deloy server component on windows 2000 server and client on windows 98 (I log in domain with administrator right). I get the following error message:

    -2147023149- Automation error
    The authentication service unknown

    Could you please tell me how to resolve this problem?

    =====================================
    These are codes on my server compenent:
    =====================================
    Const modName = "Authorization.UserManage"

    Private Declare Function NetUserChangePassword Lib "NETAPI32.DLL" (ByVal domainname As String, ByVal userName As String, ByVal oldpassword As String, ByVal newpassword As String) As Long

    Public Function CheckUser(sComputerName As Variant, sUserName As Variant, sPassword As Variant) As Variant
    Dim rc As Long
    On Error GoTo ErrorHandle
    rc = NetUserChangePassword(StrConv(sComputerName, vbUnicode), StrConv(sUserName, vbUnicode), StrConv(sPassword, vbUnicode), StrConv(sPassword, vbUnicode))
    CheckUser = rc
    Exit Function
    ErrorHandle:
    Err.Raise Err.Number, SetErrSource(modName, "Customer Information"), Err.Description
    End Function

    Public Function Login(sUserName As Variant, sPassword As Variant) As Variant
    Dim conn As ADODB.Connection
    Dim Rs As ADODB.Recordset
    Dim ctxObject As ObjectContext
    Dim strComputerName As String

    On Error GoTo ErrorHandle
    Login = 1
    Set ctxObject = GetObjectContext()
    Set conn = ctxObject.CreateInstance("ADODB.Connection")
    conn.Open "DSN=" & SYSDSNBDS & ";UID=" & DB_USERNAME & ";PWD=" & RetrieveProperty("SecuInfo", "PWSA") & ";"
    strSQL = "SELECT * FROM TLPROFILES WHERE TLName='" & sUserName & "'"
    strComputerName = GetComputerName
    If CheckUser(strComputerName, sUserName, sPassword) <> 0 Then Exit Function
    Set Rs = ctxObject.CreateInstance("ADODB.Recordset")
    Rs.Open strSQL, conn, adOpenForwardOnly, adLockReadOnly
    If Rs.EOF Then Exit Function

    ctxObject.SetComplete
    Login = 0
    Exit Function
    ErrorHandle:
    ' Clean up object on the way out.
    If Not conn Is Nothing Then
    Set conn = Nothing
    End If

    ' Roll back MTS transaction set.
    ctxObject.SetAbort
    Err.Raise Err.Number, SetErrSource(modName, "Customer Information"), Err.Description
    End Function

    Public Function GetUserInfo(sUserName As Variant) As ADODB.Recordset
    Dim conn As ADODB.Connection
    Dim Rs As ADODB.Recordset
    Dim ctxObject As ObjectContext

    On Error GoTo ErrorHandle
    Set ctxObject = GetObjectContext()
    Set conn = ctxObject.CreateInstance("ADODB.Connection")
    conn.Open "DSN=" & SYSDSNBDS & ";UID=" & DB_USERNAME & ";PWD=" & RetrieveProperty("SecuInfo", "PWSA") & ";"
    strSQL = "SELECT * FROM TLPROFILES WHERE TLName='" & sUserName & "'"
    Set Rs = ctxObject.CreateInstance("ADODB.Recordset")
    Rs.Open strSQL, conn, adOpenForwardOnly, adLockReadOnly
    ctxObject.SetComplete
    Set GetUserInfo = Rs
    Exit Function
    ErrorHandle:
    ' Clean up object on the way out.
    If Not conn Is Nothing Then
    Set conn = Nothing
    End If

    ' Roll back MTS transaction set.
    ctxObject.SetAbort
    Err.Raise Err.Number, SetErrSource(modName, "Customer Information"), Err.Description
    End Function

    =====================================
    These are codes on my login form:
    =====================================

    Option Explicit

    Public LoginSucceeded As Boolean

    Private Sub cmdCancel_Click()
    'set the global var to false
    'to denote a failed login
    LoginSucceeded = False
    'Me.Hide
    Unload Me
    End Sub

    Private Sub cmdOK_Click()
    Dim objAutho As Authorization.UserManage
    Dim Rs As ADODB.Recordset

    On Error GoTo ErrorHandle

    Set objAutho = CreateObject("Authorization.UserManage")
    'strComputerName = GetComputerName
    'check for correct password
    If objAutho.Login(Trim(txtUserName), txtPassword) = 0 Then
    'place code to here to pass the
    'success to the calling sub
    'setting a global var is the easiest
    Set Rs = New ADODB.Recordset
    Set Rs = objAutho.GetUserInfo(Trim(txtUserName))
    USERID = Rs("TLNAME")
    USERSUBBRID = Rs("TLSUBBRID")
    If USERSUBBRID <> RetrieveProperty("SecuInfo", "BRID") Then
    MsgBox "Branch ID is not valid!", , "Login"
    txtPassword.SetFocus
    SendKeys "{Home}+{End}"
    Exit Sub
    End If
    frmMain.Show
    LoginSucceeded = True
    'Me.Hide
    Unload Me
    Else
    MsgBox "Invalid Password, try again!", , "Login"
    txtPassword.SetFocus
    SendKeys "{Home}+{End}"
    End If
    Exit Sub
    ErrorHandle:
    MsgBox Err.Number & "- " & Err.Source & " - " & Err.Description
    End Sub

    Private Sub Form_Load()
    On Error GoTo ErrorHandle
    Dim obj As Authorization.Sysvar
    Dim objHost As SBAuthorization.SBSysvar
    Set obj = CreateObject("Authorization.Sysvar")
    Call obj.LoadSysvar
    Set objHost = CreateObject("SBAuthorization.SBSysvar")
    Call objHost.LoadSysvar
    Exit Sub
    ErrorHandle:
    MsgBox Err.Number & " - " & Err.Description
    End Sub

    ========================================
    When I click on the OK button I get the above error

    Thanks in advance,

    Trung Luu

  2. #2

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