Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table buffering error
Message
De
06/11/2001 15:02:49
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00577587
Message ID:
00578174
Vues:
32
Okay, put this code in that same commandButton click() (replacing what you currently have in there). Hard code the invoice_ID on the second line. Run the form and click the button (you know the drill *grin*). Don't add any commands for buffering at this point. If you don't get any errors, manually open product table and make sure it worked.
local lcInvoice_ID, lnCurrentSeason
lnInvoice_ID = 12345   && replace this with a valid invoice number
                       &&     and the correct datatype, of course
lnCurrentSeason = 5

activate screen
set deleted on
Select * from InvoiceDetail Where Invoice_ID = lnInvoice_ID ;
    into cursor InvLinesCursor
scan   && we are scanning invLinesCursor, not invoiceDetail table
    if indexseek (InvLinesCursor.Product_ID, .t., 'product', 'product_id')
        * product found
        ? "updating product: ",invLinesCursor.Product_ID
        select product
	Replace UseSeason with lnCurrentSeason
    else
        * product not found...error processing here
        * referential integrity is supposed to prevent this
        ? "Error, product not found: ",invLinesCursor.Product_ID
    endif
endscan
As far as running the form without compiling, it can save you some time and trouble. You should be able to have a small program that creates the necessary variables and runs the form.

It sounds like the system may have some global variables, which can be quite troublesome. But, that is another topic...



>Done, it worked just fine too. Both records changed, no errors.
>
>I have not set a break point and I don't really know how.
>I suspect to do that you have to run the form interactively.
>I've never been able to do that. I always have to build and run the exe file.
>If I try to run the main screen directly I get the error.
>"Variable STARTDIRECTORY not found."
>The creator of this sytem does all sorts of stuff with an INI file.
>It may have to do with that.
>I could probably create some variables first and then run the main form interactively.
>
>>Okay, try it again with the change below (to change 2 records).
>>
>>When your code crashes, does it error out on the first line of the invoice detail? Have you set a breakpoint in your form and stepped through it in the debugger?
>>
>>>That did update the first record of the Product file fine.
>>>BTW - UseSeason is numeric.
>>>
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform