Visual Basic de bir garip sorun

xonurx

New member
arkadaslar bakıyorum bakıyorum çözemiyorum birde siz baksanız şimdi olay şu ben bir veritabanıyla çalışmak istiyorum herşey tamam fakat db ye veri girmeye çalıştığımda sorun çıkartıyor data1.recordset.addnew türü bi hata kodlara bi baksanız diyorum belki birşey çıkartabiliriz?

Kod:
Kod:
Private Sub cmdAdd_Click()
On Error Resume Next (Bunda Sonradan Ekledim Programda Kumsaati Çıkıyor Hiçbirşey Yapmıyor
[B][COLOR="Red"]Data1.Recordset.AddNew[/COLOR][/B]
Data1.Recordset.Update ( Bunu Sonradan Ekledim Ama Buda Olmadı)

End Sub

Private Sub cmdDelete_Click()
  'this may produce an error if you delete the last
  'record or the only record in the recordset
  Data1.Recordset.Delete
  Data1.Recordset.MoveNext
End Sub

Private Sub cmdRefresh_Click()
  'this is really only needed for multi user apps
  Data1.Refresh
End Sub

Private Sub cmdUpdate_Click()
  Data1.UpdateRecord
  Data1.Recordset.Bookmark = Data1.Recordset.LastModified
End Sub

Private Sub cmdClose_Click()
  Unload Me
End Sub

Private Sub Data1_Error(DataErr As Integer, Response As Integer)
  'This is where you would put error handling code
  'If you want to ignore errors, comment out the next line
  'If you want to trap them, add code here to handle them
  MsgBox "Data error event hit err:" & Error$(DataErr)
  Response = 0  'throw away the error
End Sub

Private Sub Data1_Reposition()
  Screen.MousePointer = vbDefault
  On Error Resume Next
  'This will display the current record position
  'for dynasets and snapshots
  Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1)
  'for the table object you must set the index property when
  'the recordset gets created and use the following line
  'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1
End Sub

Private Sub Data1_Validate(Action As Integer, Save As Integer)
  'This is where you put validation code
  'This event gets called when the following actions occur
  Select Case Action
    Case vbDataActionMoveFirst
    Case vbDataActionMovePrevious
    Case vbDataActionMoveNext
    Case vbDataActionMoveLast
    Case vbDataActionAddNew
    Case vbDataActionUpdate
    Case vbDataActionDelete
    Case vbDataActionFind
    Case vbDataActionBookmark
    Case vbDataActionClose
  End Select
  Screen.MousePointer = vbHourglass
End Sub
 

ibrahimkaya396

New member
Private Sub cmdAdd_Click()
On Error Resume Next (Bunda Sonradan Ekledim Programda Kumsaati Çıkıyor Hiçbirşey Yapmıyor
Data1.Recordset.AddNew
Data1.Recordset.Update ( Bunu Sonradan Ekledim Ama Buda Olmadı)

End Sub

ustacım iki işlemi aynı anda yapamazsın ilk once adnew olayını gercekleştir sonra update olayını ve mümkünse aynı clik olayı içinde olmasın

calısmalarının devamını dilerim
 

angelbir

New member
toys_hell haklı bir sub ( yordam ın) ın altında 2 farklı işlem arda arda yapılması pek mantıklı değil hele ki biri ekleme diğeri güncelleme işlemi ise bu çok garip olur. :D
 

HTML

Üst