Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table buffering error
Message
From
06/11/2001 15:33:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00577587
Message ID:
00578183
Views:
32
See change below. What do you get as the result of the _tally? Also, you can run the select statement from the command window and see what you get.

Are you saying the ELSE portion did not get executed either? Either the cursor is empty, or the products are not being found in the product table. Is there a screen area behind the form where things can be displayed?

Also, try this from the command window:
* manually USE the product table
? indexseek ('PutProductIDHere', .t., 'product', 'product_id')
Does it find the product?



>Now I really don't understand this.
>There is no change to the product file. I see no printed message either.
>I thought maybe the form hid the messages, so, I put message boxes right before the messages and they do not display.
>I added message boxes just before the Select and the Scan commands and both of those display. I have verfied that the invoice number is right. (31984)
>
>>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 = 31984   && 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
<b>? "Records selected: ",_tally
select invLinesCursor</b>
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
>>
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform