![]() |
FlowFact - Entwicklungstools |
![]() |
Function | AD_GetName(ByVal rsAd As ADODB.Recordset, ByRef strTitle As Variant, ByRef strFirstName As Variant, ByRef strFamilyName As Variant) As Boolean |
rsAD: Recordset der von AD_New oder AD_Find_XXX zurückgegeben wurde. Auch ein 'm_oBase.FF_GetRecordset("SELECT * FROM AD ...")' ist möglich. strTitle: Titel strFirstName: Vorname strFamilyName: Nachname Rückgabewert: False = kein aktueller Datensatz in rsAd Public Function AD_GetName(ByVal rsAd As ADODB.Recordset, ByRef strTitle As Variant, ByRef strFirstName As Variant, ByRef strFamilyName As Variant) As Boolean Dim strName As String Dim strTitleList As String Dim strBuffer As String Dim strText As String Dim p As Long AD_GetName = False strTitle = "" strFirstName = "" strFamilyName = "" If rsAd Is Nothing Then Exit Function End If If rsAd.EOF = True Then Exit Function End If strName = m_oUtil.k(rsAd("NAME").value) '** Nachname strFamilyName = m_oUtil.k(rsAd("IDX_NAME").value) If Len(strName) > Len(strFamilyName) Then strName = Trim(Mid(strName, 1, Len(strName) - Len(strFamilyName))) Else strName = "" End If '** Title und Vornamen trennen strTitleList = STD_GetField("TITEL") strTitleList = Replace(strTitleList, vbCrLf, " ") strTitleList = " " + UCase(strTitleList) + " " strBuffer = Trim(strName) While strBuffer <> "" strText = oTools.StrList_DeleteFirst(strBuffer, " ") p = InStr(strTitleList, UCase(" " + strText + " ")) If p > 0 Then strTitle = Trim(strText & " " & strTitle) Else strFirstName = Trim(strText & " " & strFirstName) End If Wend AD_GetName = True End Function |