title image


Smiley Problem mit Transaktion
Mein Code





Private Sub btn_Buch_Click()



Dim db As DAO.Database

Dim ws As DAO.Workspace

Dim rstBuch As DAO.Recordset



Set ws = DBEngine.Workspaces(0)

Set db = CurrentDb()

Set rstBuch = db.OpenRecordset("tblBuch")



On Error GoTo Err_btn_Buch_Click

ws.BeginTrans

If IsNull(Me!Buch) Then

MsgBox "Name von Buch fehlt!", vbInformation, "Buch?"

ws.Rollback

Exit Sub

Else

If CurrentDb.OpenRecordset("select * from tblBuch where " & _

"Buch= '" & Me!Buch & "'").RecordCount > 0 Then



MsgBox "Buch bereits vorhanden!", vbInformation, "doppelter DS"

Me!Buch = Null

ws.Rollback

Exit Sub

Else

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

ws.CommitTrans

End If

...









Was ist daran falsch?



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: