Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table buffering error
Message
 
To
06/11/2001 15:33:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00577587
Message ID:
00578208
Views:
33
The screen is a pretty busy one so if it is printing results, I'm not seeing them. Remember, I'm having to run the EXE file, not the form interactively.
(I think I mentioned that to you and not Tom)

I added your changes and because I did not see the reslults of the "?" I added another message box to just before the Scan command:
MessageBox(str(_tally),0,"Records Selected")
It returns 0. That should work too right?

Because I am running the EXE file, I'm not sure what I would enter in the command window. I tried
select invLinesCursor
And it says "ALIAS 'INVLINECURSOR' is not found. I think that would probably be right though since I made the cursor using the EXE file, but I thought I'd give it a try.

Doing this:
? indexseek (94, .t., 'product', 'product_id')
In the command window returns .T.

And, yes. It does look like it didn't do the If Indexseek or the else since neither message box displayed.


>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
>
>>>
___________________________
Kenneth Wonderley
http://www.wonderley.com


...the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness and self-control.
Galatians 5:22 & 23
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform