Arkadaşlar merhaba,access veritabanı oluşturdum ve bunu programıma bağlamak icin yabancı bir siteden kod buldum.ancak yabancı siteden bulduğum kod kendi orneğinde calışıyor ama ben uyarladığım zaman calışmıyor..sadece gorsellikte değişiklikler yaptım ve her kodu yerli yerine koydum.ama aşağıda kırmızı ile gosterdiğim yerlerde hata veriyor..bir bakarsanız sevinirim..neden bu hataları benim orneğimde veriyor anlamadım??
İşte Kod:
Option Explicit
'Dim as Public, which allows these variables to be used by all forms and modules within
'this VB project.
Public db As Database
Public rstInfo As Recordset
Private Sub Command1_Click()
With rstInfo
If rstInfo.RecordCount > 0 Then
.MoveNext
If rstInfo.EOF Then
MsgBox "End of file.", vbOKOnly, " Error!"
.MoveLast
Exit Sub
Else
.Edit
Text1.Text = !Isim
Text2.Text = !Soyad
Text3.Text = !CepTelefonu
Text4.Text = !Email
End If
Else
MsgBox "No Records In The DataBase."
End If
End With
End Sub
Private Sub Command2_Click()
With rstInfo
If rstInfo.RecordCount > 0 Then
.MovePrevious
If rstInfo.BOF Then
MsgBox "Front End of file.", vbOKOnly, " Error!"
.MoveFirst
Exit Sub
Else
.Edit
Text1.Text = !Isim
Text2.Text = !Soyad
Text3.Text = !CepTelefonu
Text4.Text = !Email
End If
Else
MsgBox "No Records In The DataBase."
End If
End With
End Sub
Private Sub Command3_Click()
With rstInfo
.AddNew
If Trim(Text1.Text) "" Then
!Isim = Text1.Text
Else
MsgBox "İsim girişi yap!", vbInformation, "Error Adding Record"
Exit Sub
End If
If Trim(Text2.Text) "" Then
!Soyad = Text2.Text
Else
!Soyad = "No Entry"
End If
If Trim(Text3.Text) "" Then
!CepTelefonu = Text3.Text
Else
!CepTelefonu = "No Entry"
End If
If Trim(Text4.Text) "" Then
!Email = Text4.Text
Else
!Email = "No Entry"
End If
.Update
End With
Call Form_Load
End Sub
Private Sub Command4_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command5_Click()
With rstInfo
If rstInfo.RecordCount > 0 Then
.Delete
If rstInfo.RecordCount = 0 Then Call Form1.Clear_Click
Else
MsgBox "No More Records"
End If
End With
Call Form_Load
End Sub
Private Sub Command6_Click()
End
End Sub
Private Sub Form_Load()
Set db = OpenDatabase(App.LogPath & "tel.mdb")
With db
Set rstInfo = .OpenRecordset("Info")
Label1.Caption = rstInfo.RecordCount & " records"
If rstInfo.RecordCount = 0 Then Exit Sub
With rstInfo
.Edit
Text1.Text = !Isim
Text2.Text = !Soyad
Text3.Text = !CepTelefonu
Text4.Text = !Email
End With
End With
End Sub
İşte bu kırmızı ile gosterdiğim yerler de hata veriyor.
__________________