Die Anzahl der Datensätz einer MySql Datenbank anzeigen lassen
-
Hallo !
Ich möchte mir gerne auf meinem Formular, wenn ich mich mit der Datenbank verbunden habe, die Anzahl der gefundenen Datensätze anzeigen lassen.
Ebenfalls soll nach einem Requery die Anzahl der gefundenen Datensätze angezeigt werden.
m_anzahl = m_pSet->GetRecordCount(); liefert mir nicht das richtige Ergebnis
Wie mach ich das ?
-
Liegt bestimmt daran:
aus der MSDN:CRecordset::GetRecordCount
Caution
The record count is maintained as a "high water mark" - the highest-numbered record yet seen as the user moves through the records. The total number of records is only known after the user has moved beyond the last record. For performance reasons, the count is not updated when you call MoveLast. To count the records yourself, call MoveNext repeatedly until IsEOF returns nonzero**.** Adding a record via CRecordset:AddNew and Update increases the count; deleting a record via CRecordset::Delete decreases the count**.**
-
Oder verwende die API von MySQL. Da gibt es einen API-Befehl.