Board index » cppbuilder » Re: TDataSet->RecNo

Re: TDataSet->RecNo


2004-01-13 08:55:41 AM
cppbuilder72
Your question is about how to use the VCL but it is posted in the install
group.
You will have a larger audience familiar with what you are asking if you
post the question in a group where the it is on topic. Try the group
borland.public.cppbuilder.vcl.components.using
. Ed
Quote
esiu wrote in message
news:40033456$ XXXX@XXXXX.COM ...
 
 

Re:Re: TDataSet->RecNo

hi,
i'm having problems with the RecNo property of TTable component. it should
return number of current record, but it always returns -1 instead. i'm
using BCB 3 and the table is a part of msaccess2000 database (odbc
connection). is there another way to get the record number? i need it to
my status bar saying "Record x of y" - RecordCount works fine, so i always
get "Record -1 of 89".
code line:
lblRecord->Caption = "Record " + (String)tblOsoby->RecNo + " of " +
(String)tblOsoby->RecordCount;
(status bar is made of panel with dbnavigator and lblRecord label,
dbnavigator works fine).
thanks for any help.
 

Re:Re: TDataSet->RecNo

"esiu" < XXXX@XXXXX.COM >wrote in message
Quote
i'm having problems with the RecNo property of TTable component.
it should return number of current record, but it always returns -1
instead.
The only way I can see that happening is if you are using a TTable component
that is not derived from TBDEDataSet. The native TTable component derives
from TBDEDataSet, which does return a valid record number for the RecNo
property. If you are not using the BDE components, then what are you
actually using exactly?
Gambit
 

{smallsort}

Re:Re: TDataSet->RecNo

i AM using the standard vcl component which is TTable and have declaration
TTable *tblOsoby;
in the __published section of the form class. and it is not working. maybe
there is some kind of issue according access2000 and bcb3? is there any
other way to get current record number? or i have to count the records
manually?
gambit, if you don't believe me i can send you some screenshots ;).
thanx for answering anyways. hope someone knows what's going on.
Użytkownik "Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >
napisa?w wiadomości news:40047609$ XXXX@XXXXX.COM ...
Quote

"esiu" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>i'm having problems with the RecNo property of TTable component.
>it should return number of current record, but it always returns -1
instead.

The only way I can see that happening is if you are using a TTable
component
that is not derived from TBDEDataSet. The native TTable component derives
from TBDEDataSet, which does return a valid record number for the RecNo
property. If you are not using the BDE components, then what are you
actually using exactly?


Gambit


 

Re:Re: TDataSet->RecNo

"esiu" < XXXX@XXXXX.COM >wrote in message
Quote
i AM using the standard vcl component which is TTable and
have declaration
TTable *tblOsoby;
in the __published section of the form class. and it is not working.
I looked into TTable's source code more deeply, and I see now that the RecNo
property only has meaning for TTable when a Paradox or DBase database is
being used.
Quote
is there any other way to get current record number?
Since you are using MSAccess as your database, you might consider changing
your code to use ADO instead. I don't know if BCB3 has native components
for ADO or not, but BCB5 and 6 have TADODataSet and TADOTable components and
such, and I do know that the RecNo property is implemented for ADO-based
tables. If you don't have ADO components available under BCB3, then either
find third-party components for it, or alternatively just program for the
ADO API directly.
Gambit