![]() |
FlowFact - Entwicklungstools |
![]() |
Function | SQL_DeleteWhere(ByVal strTable As String, ByVal strWhere As String) As Long |
strTable: Tabellenname strWhere: WHERE-Teil einer SELECT-Abfrage (ohne WHERE!) Rückgabewert: Anzahl der gelöschten Datensätze Public Function SQL_DeleteWhere(ByVal strTable As String, ByVal strWhere As String) As Long Dim lngResult As Long Dim strSQL As String Dim rs As ADODB.Recordset lngResult = 0 strSQL = "" If Trim(strWhere) <> "" Then strSQL = strSQL & " WHERE " & strWhere End If Set rs = FF_GetRecordset("SELECT * FROM " & strTable & " " & strSQL) While rs.EOF = False lngResult = lngResult + 1 rs.Delete rs.MoveNext Wend FF_UpdateRecordset rs SQL_DeleteWhere = lngResult End Function |