Update an Array Fails in the same form !

The place for peer-to-peer support for VPM Enterprise 9.1, our latest framework.

Update an Array Fails in the same form !

Postby expresys » Tue Jul 18, 2017 2:36 pm

Hi, Can anyone help me with the update of an Array within a Form ? I save a Record in a table and then I have to create a Sql in the form . But the record I Just save does not apear in the arroy. Always only the last record. But if I go out the form and run again it Apears ! Is There any command or step that I am missing in order to refresh the Query result in the array ? If I place the SQL result in a Cursor and Browse it works perfect.
Thanks Oscar

I Changed the Status in the table Shipment from "I" to "C" then in the same form I run this Sql:

Select Padr( Shipment.shpnum , 4, Space(1) ) + " | " + DTOC(shipment.shpdate) + " | "+ shipment.shpdoc + " | "+ shipment.shptype;
From Shipment ;
WHERE Shipment.shpStatus = "C";
Into Array aAllItems ;
Order By Shpnum
expresys
 
Posts: 155
Joined: Tue Jul 06, 2010 1:45 am

Re: Update an Array Fails in the same form !

Postby stecenko » Tue Jul 18, 2017 5:16 pm

Is it possible that you have table buffering on for Shipment? If so, try record buffering.
Richard Stecenko
Interactive Computer Services Inc.
Victoria, British Columbia
204.453.2052
stecenko
 
Posts: 822
Joined: Mon Jun 21, 2010 8:06 pm
Location: Saanich, British Columbia

Re: Update an Array Fails in the same form !

Postby expresys » Tue Jul 18, 2017 10:28 pm

Hi, Mr. Richard thanks for you answer ! I did try every possible mode for Buffering in that table and for the form
like None, default, pesimistic, optimistic etc.. and nothing works !
expresys
 
Posts: 155
Joined: Tue Jul 06, 2010 1:45 am

Re: Update an Array Fails in the same form !

Postby Bob » Wed Jul 19, 2017 5:20 am

Try adding the BUFFERING clause...

SELECT Padr( Shipment.shpnum , 4, Space(1) ) + " | " + DTOC(shipment.shpdate) + " | "+ shipment.shpdoc + " | "+ shipment.shptype;
FROM Shipment WITH BUFFERING=.t. ;
WHERE Shipment.shpStatus = "C";
INTO ARRAY aAllItems ;
ORDER BY Shpnum
Bob
 
Posts: 718
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY

Re: Update an Array Fails in the same form !

Postby expresys » Wed Jul 19, 2017 4:00 pm

Thanks Bob but this clause does not works ! Error.
expresys
 
Posts: 155
Joined: Tue Jul 06, 2010 1:45 am

Re: Update an Array Fails in the same form !

Postby Bob » Wed Jul 19, 2017 4:25 pm

What you describe reflects buffering in VFP. Even a 'saved' record may not be written to disk until the record pointer is moved. SQL draws records from disk unless the buffering clause is used. I believe that using WITH BUFFERING=.t. actually commits the record to disk.

Would not apply to a SQL server backend, but not sure what your situation is.
Bob
 
Posts: 718
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY

Re: Update an Array Fails in the same form !

Postby stecenko » Wed Jul 19, 2017 11:47 pm

Hi,

You said, 'Error'
Are you getting an error or does the buffer clause not solve your problem?
Those are 2 different issues.

When you say 'I save a record in a table', do you actually have a tableupdate(.t., .t.) for the table. That for sure causes the record to be written to the back end.
Richard Stecenko
Interactive Computer Services Inc.
Victoria, British Columbia
204.453.2052
stecenko
 
Posts: 822
Joined: Mon Jun 21, 2010 8:06 pm
Location: Saanich, British Columbia

Re: Update an Array Fails in the same form !

Postby stecenko » Wed Jul 19, 2017 11:50 pm

Also, Mr. Oscar, why am I Mr. Richard, but Bob is plain old Bob? We're all equals here.
Richard Stecenko
Interactive Computer Services Inc.
Victoria, British Columbia
204.453.2052
stecenko
 
Posts: 822
Joined: Mon Jun 21, 2010 8:06 pm
Location: Saanich, British Columbia

Re: Update an Array Fails in the same form !

Postby expresys » Thu Jul 20, 2017 12:11 pm

Plain for US Citizen & Mr. for Canadians ! Jejjejejs Just Kidding ! for now on Richard!
The Error of the with Buffering=.t. is " Command contains unrecognized phrase/keyboard." ! I think the solution is close to appear ! this only happend with the array in th combbox ! If I use a plane sql to a cursor it works perfect!
Thanks Oscar
expresys
 
Posts: 155
Joined: Tue Jul 06, 2010 1:45 am

Re: Update an Array Fails in the same form !

Postby Bob » Thu Jul 20, 2017 5:52 pm

Combobox? That's new ... maybe you only need to call the refresh method of that control ....
Bob
 
Posts: 718
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY

Next

Return to VPM Enterprise 9.1

Who is online

Users browsing this forum: No registered users and 4 guests

cron