G
Gregory A Greenman
If I have a table ("tbl") in a dataset ("ds") with these three
fields:
pk - autoincrement, seed = -1, step = -1
fld0
fld1
and I add a new row, how can I find its row number for the
default view?
Here's some sample code:
---------------
dim dr as datarow
dim lngIndex as long
dr = ds.tables("tbl").newrow
dr("fld0") = 100
dr("fld1") = "Hello World"
ds.tables("tbl").rows.add(dr)
lngIndex = getNumberOfTheRowIJustAdded
---------------
What do I replace "getNumberOfTheRowIJustAdded" with in order to
get the new row number if I want it for a default view?
Unfortunately, the find method returns the row itself, rather
than its number. Since I can't see any way to determine the row
number from that, it doesn't solve my problem. The only solution
I see is to iterate through the data until I have a match.
Also, am I correct in assuming that the number of the newly added
row is the same as ds.tables("tbl").rows.count - 1 if I am not
using a view?
Thanks for any help.
fields:
pk - autoincrement, seed = -1, step = -1
fld0
fld1
and I add a new row, how can I find its row number for the
default view?
Here's some sample code:
---------------
dim dr as datarow
dim lngIndex as long
dr = ds.tables("tbl").newrow
dr("fld0") = 100
dr("fld1") = "Hello World"
ds.tables("tbl").rows.add(dr)
lngIndex = getNumberOfTheRowIJustAdded
---------------
What do I replace "getNumberOfTheRowIJustAdded" with in order to
get the new row number if I want it for a default view?
Unfortunately, the find method returns the row itself, rather
than its number. Since I can't see any way to determine the row
number from that, it doesn't solve my problem. The only solution
I see is to iterate through the data until I have a match.
Also, am I correct in assuming that the number of the newly added
row is the same as ds.tables("tbl").rows.count - 1 if I am not
using a view?
Thanks for any help.