FlowFact - Entwicklungstools v19.881 FLOWFACT 2017 R2 - Function - Sql_GetField

Feldinhalt abfragen

Diese Funktion liefert den Inhalt eines einzelnen Feldes aus dem Datensatz, der der angegebene DSN entspricht.
Function Sql_GetField(ByVal strTable As String, strDsn As String, strFieldName As String) As String


strTable: Tabellenname
strDsn: Datensatznummer
strFieldName: Feldname


Public Function Sql_GetField(ByVal strTable As String, strDsn As String, strFieldName As String) As String
    Dim rs As ADODB.Recordset
    Dim strSQL As String

    strSQL = "SELECT " & strFieldName & " FROM " & strTable & " WHERE dsn=" & m_oUtil.SqlUid(strDsn) & " "
    Set rs = FF_GetRecordset(strSQL)
    If Not rs.EOF Then
        Sql_GetField = m_oUtil.k(rs(strFieldName))
    Else
        Sql_GetField = ""
    End If
End Function