Hauptmenü
MS-Access
Lösung:
Public Sub DWriteUp _ (strFeld As String, _ strTabelle As String, _ strBedingung As String, _ varWrite As Variant _ ) Dim db As Database Dim rs As Recordset Set db = CurrentDb() Set rs = db.OpenRecordset( _ "SELECT " & strFeld & " " & _ "FROM " & strTabelle & " " & _ "WHERE " & strBedingung & ";") rs.LockEdits = True If Not rs.EOF Then rs.Edit rs(0) = varWrite rs.Update End If Set rs = Nothing Set db = Nothing End Sub |
Public Sub ExtDWriteUp _ (strDB As String, _ strFeld As String, _ strTabelle As String, _ strBedingung As String, _ varWrite As Variant _ ) Dim db As Database Dim rs As Recordset Set db = DBEngine.OpenDatabase(strDB) Set rs = db.OpenRecordset( _ "SELECT " & strFeld & " " & _ "FROM " & strTabelle & " " & _ "WHERE " & strBedingung & ";") rs.LockEdits = True If Not rs.EOF Then rs.Edit rs(0) = varWrite rs.Update End If Set rs = Nothing Set db = Nothing End Sub |