Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

mdb gibt kein EOF zurück

Empfohlene Antworten

Veröffentlicht

Hallo,

ich durchlaufe per ADO eine MDB-Datenbank mit VB6.

Ich habe die Tabelle mit ein paar Testwerten gefüllt.

Mit dem Button next soll der nächste Datensatz angezeigt werden.

tabell.EOF gibt mir aber immer FALSCH zurück und deshalb laufe ich immer über

die Tabelle hinaus. Für einen Tipp wäre ich dankbar.

 

Public db As Database

Public tabelle As Recordset

Public dbdatei As String



Private Sub Form_Load()

dbdatei = App.Path + "\piknik.mdb"

Set db = Workspaces(0).OpenDatabase(dbdatei, False, False)

Set tabelle = db.OpenRecordset("speise")




Private Sub next_Click()




If Not tabelle.EOF Then tabelle.MoveNext


Tnr.Text = tabelle("nr")

TBezeichnung.Text = tabelle("bezeichnung")

TPreis.Text = tabelle("preis")

TZutat.Text = tabelle("zutat")

TMwSt.Text = tabelle("mwst")



End Sub


Hi,

keine Sorge, tabelle.EOF funktioniert schon.

Das Problem bei deiner Abfrage ist, das beim letzten Datensatz ein MoveNext gemacht wird, und danach ohne Gültigkeitsabfrage der Zugriff erfolgt!!!!

Machs besser so:


If tabelle.EOF Then Exit Sub
tabelle.MoveNext
If Not tabelle.EOF Then
TNr.Text = tabelle("nr")
TBezeichnung.Text = tabelle("bezeichnung")
TPreis.Text = tabelle("preis")
TZutat.Text = tabelle("zutat")
TMwSt.Text = tabelle("mwst")
End If
[/PHP]

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.