Visual FoxPro Developer Center > Visual FoxPro Forums > Visual FoxPro General > I have no controlsource in my forms, do I need to buffer tables at all?
Ask a questionAsk a question
 

AnswerI have no controlsource in my forms, do I need to buffer tables at all?

  • Friday, November 06, 2009 1:31 PMLarry_Nuñez Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I don´t use a controlsource for my forms, I control how the data is going to be recorded and treated. Do I need to buffer tables for multiusers? Tableupdate commands are useless because I use SQL commands such as insert into commands and updates commands.

Answers

  • Saturday, November 07, 2009 11:31 AMAndyKrMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I don´t use a controlsource for my forms, I control how the data is going to be recorded and treated. Do I need to buffer tables for multiusers? Tableupdate commands are useless because I use SQL commands such as insert into commands and updates commands.

    TableUpdate has nothing to do with whether you use controlsources or not. The function attempts to commit changes that are pending in a table buffer to the file. It doesn't matter HOW the change gets into the buffer, all that matters is that the data in the buffer is different from that in the file on disk.

    Of course, if you open your tables implicitly using SQL then by default they will NOT be buffered (and TableUpdate will not work) so you should ensure that your tables are explicitly opened - either in the DataEnvironment, or with USE commands in your Form Load.

    So the answer to your questioni is YES you should use buffering, and  TableUpdate commands, even if you only update data using SQL.
    -- Andy Kramek

All Replies

  • Saturday, November 07, 2009 11:31 AMAndyKrMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I don´t use a controlsource for my forms, I control how the data is going to be recorded and treated. Do I need to buffer tables for multiusers? Tableupdate commands are useless because I use SQL commands such as insert into commands and updates commands.

    TableUpdate has nothing to do with whether you use controlsources or not. The function attempts to commit changes that are pending in a table buffer to the file. It doesn't matter HOW the change gets into the buffer, all that matters is that the data in the buffer is different from that in the file on disk.

    Of course, if you open your tables implicitly using SQL then by default they will NOT be buffered (and TableUpdate will not work) so you should ensure that your tables are explicitly opened - either in the DataEnvironment, or with USE commands in your Form Load.

    So the answer to your questioni is YES you should use buffering, and  TableUpdate commands, even if you only update data using SQL.
    -- Andy Kramek