Board index » delphi » Copy one table record

Copy one table record

My basic need is to assign a unique number to a new record in a specified
range so I can write the current table record to it. If I read the table to
look for the first non-used number in the range, I overwrite the current
table record. It seems as if I need to create another identically defined
table and use it to store the current record. I don't know how to move the
current record to the new table. BatchMove seems to only be able to move all
the records in the table. I would appreciate suggestions. I suppose a single
record move exists, but I was unable to find it.

Larry

 

Re:Copy one table record


"Lawrence A Wheeler" <lawhee...@dsl.telocity.com> wrote in message
news:39c89dd7$1_2@dnews...

Quote
> My basic need is to assign a unique number to a new record in a specified
> range so I can write the current table record to it. If I read the table
to
> look for the first non-used number in the range, I overwrite the current
> table record. It seems as if I need to create another identically defined
> table and use it to store the current record. I don't know how to move the
> current record to the new table. BatchMove seems to only be able to

Use a second TTable to scan the table looking for the next number to use.
That way the original table (which is probably in Insert mode) is not
affected while you search.

Woody

Re:Copy one table record


Thanks for the response. Other than having to maintain the second table this
seems like a good solution. What is the significance of your comment about
the insert mode.

Larry

Quote
woody <woody....@ih2000.net> wrote in message news:39c8a86d_2@dnews...
> "Lawrence A Wheeler" <lawhee...@dsl.telocity.com> wrote in message
> news:39c89dd7$1_2@dnews...
> > My basic need is to assign a unique number to a new record in a
specified
> > range so I can write the current table record to it. If I read the table
> to
> > look for the first non-used number in the range, I overwrite the current
> > table record. It seems as if I need to create another identically
defined
> > table and use it to store the current record. I don't know how to move
the
> > current record to the new table. BatchMove seems to only be able to

> Use a second TTable to scan the table looking for the next number to use.
> That way the original table (which is probably in Insert mode) is not
> affected while you search.

> Woody

Re:Copy one table record


"Lawrence A Wheeler" <lawhee...@dsl.telocity.com> wrote in message
news:39c9eeaf$1_2@dnews...

Quote
> Thanks for the response. Other than having to maintain the second table
this
> seems like a good solution. What is the significance of your comment about
> the insert mode.

I was assuming you were inserting a new record based on what you said
originally. See below.

Quote
> My basic need is to assign a unique number to a new record in a
> specified
> range so I can write the current table record to it. If I read the table

This tells me you are creating a new record using Insert (or append) and you
need to assign the number then. If you use the same table to look up the
value, then the table will either be posted as is or cancelled before the
pointer is moved. Sorry if that's not the case but it just seemed obvious to
me.

Woody

Other Threads