Skip to content

deleteallrecordsfromtable(vola1table)

Forums Forums SIMPOL Programming deleteallrecordsfromtable(vola1table)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #82
    Dan Jinks
    Participant

    I tried to use the subject function from db1util.lib on a vola1table. It hangs the debugger. I looked at the code and it does not seem to account for vola1tables, so I’m creating a modified version just for vola1tables. I cannot seem to find a volabase equivalent to the sbme1.deletetable method, which is used in the function. Looks like I will have to delete each record individually. Does this seem like the logical approach?

    #1899
    Michael
    Keymaster

    On 30/07/2011 05:46, djinks wrote:
    > I tried to use the subject function from db1util.lib on a vola1table.
    > It hangs the debugger. I looked at the code and it does not seem to
    > account for vola1tables, so I'm creating a modified version just for
    > vola1tables. I cannot seem to find a volabase equivalent to the
    > sbme1.deletetable method, which is used in the function. Looks like
    > I will have to delete each record individually.
    >
    > Does this seem like the logical approach?

    I seem to recall that when I created vola1base, it wasn't possible to
    modify sbme1 tables, so some functions that were added later to sbme1
    have not made it into vola1base yet. Also, it might be easier (and much
    faster) to just drop the vola1base and create a new one, rather than
    delete each record. I don't know that there is a deletetable function. I
    am pretty sure that the expectation was that it would be easier to just
    create a new one. Most people would be using vola1base with only 1 table
    anyway.

    Ciao, Neil

    #1900
    Dan Jinks
    Participant

    I thought of that, but I already have the volaifields used in a detail
    block on the form. The form also has a vola1base datasource. I would
    have to:

    1. remove the detail block
    2. Close the table
    3. remove the form's datasource
    4. remove and recreate the vola1base
    5. recreate the vola1table
    6. open the table
    7. recreate the forms datasource
    8. recreate the detail block.

    Seemed like just removing the records or deleting the table would be
    preferred . Can I bypass any of those steps? It worked ok when I tested
    it with a sbme file, using the delete table method, so I guess some of
    the above may not be necessary, but I am unsure.

    -Dan

    On 8/1/2011 9:11 AM, Neil Robinson wrote:
    > On 30/07/2011 05:46, djinks wrote:
    >> I tried to use the subject function from db1util.lib on a vola1table.
    >> It hangs the debugger. I looked at the code and it does not seem to
    >> account for vola1tables, so I'm creating a modified version just for
    >> vola1tables. I cannot seem to find a volabase equivalent to the
    >> sbme1.deletetable method, which is used in the function. Looks like
    >> I will have to delete each record individually.
    >>
    >> Does this seem like the logical approach?
    >
    > I seem to recall that when I created vola1base, it wasn't possible to
    > modify sbme1 tables, so some functions that were added later to sbme1
    > have not made it into vola1base yet. Also, it might be easier (and much
    > faster) to just drop the vola1base and create a new one, rather than
    > delete each record. I don't know that there is a deletetable function. I
    > am pretty sure that the expectation was that it would be easier to just
    > create a new one. Most people would be using vola1base with only 1 table
    > anyway.
    >
    > Ciao, Neil

    #1901
    Michael
    Keymaster

    On 01/08/2011 16:35, djinks wrote:
    > I thought of that, but I already have the volaifields used in a
    > detail block on the form. The form also has a vola1base datasource.
    > I would have to:
    >
    > 1. remove the detail block
    > 2. Close the table
    > 3. remove the form's datasource
    > 4. remove and recreate the vola1base
    > 5. recreate the vola1table
    > 6. open the table
    > 7. recreate the forms datasource
    > 8. recreate the detail block.

    I see. Yes, if you are using the field references as control sources,
    then it isn't so straightforward.

    > Seemed like just removing the records or deleting the table would be
    > preferred . Can I bypass any of those steps? It worked ok when I
    > tested it with a sbme file, using the delete table method, so I guess
    > some of the above may not be necessary, but I am unsure.

    I don't think that you can delete the table either, since the reference
    to the table will be in every data-aware control on the form, resulting
    in the same problem you had before. The only thing you can do is delete
    all the records. It may be possible to add a deleteall() method to the
    vola1table and I can do some internal tricks to remove the records
    faster, I will have to check.

    Ciao, Neil

    #1903
    Dan Jinks
    Participant

    Hello Neil,
    Yes, I think you are right. When I was working with an sbme file, I
    never passed the optimize=.true parameter to
    deleteallrecordfromdb1table(), so it used the record.delete iteration.
    I appreciate anything you can do here. My only work around is to use an
    sbme file, but I thought vola1base would be faster.

    -Dan

    On 8/1/2011 5:35 PM, Neil Robinson wrote:
    > I don't think that you can delete the table either, since the reference
    > to the table will be in every data-aware control on the form, resulting
    > in the same problem you had before. The only thing you can do is delete
    > all the records. It may be possible to add a deleteall() method to the
    > vola1table and I can do some internal tricks to remove the records
    > faster, I will have to check.
    >
    > Ciao, Neil

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.