Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data in one station appear in another station?
Message
From
21/07/1999 12:05:59
 
 
To
06/07/1999 05:17:30
Andrzej Majlich
Vulcan sp. z o. o.
Wroclaw, Poland
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00058304
Message ID:
00244196
Views:
32
i had also similar problem when using buffered invoice rows.
I can replicate this problem: I can open three instances of program
in different windows and when entering invoice rows simultaneously,
rows from other instance will appear in other windows.

I think that when adding rows, their record numbers are -1, -2 etc.
(same in all instances) and this confuses fox.

Finally, I was unable to use this way of editting.
Instead I create a local cursor and edit invoice rows in this
cursor. Save command adds rows from locak cursor to network table
and makes tablerevert() to local cursor. This is a good
invoice editing tip described in www.computer-consultint.com vfp tips.


>Hi,
>
>I've noticed very similiar behaviour of my apps in VFP 5.0a - have you found some solution?
>
>>I have this strange problem. When I am in network environment, my invoice details sometimes get clobber up with data from another station. Any idea what is the reason?
>>
>>I am using NEWID() function in TASTRADE to generate my master table primary key (surrogated). In my grid, I set ALLOWADDNEW = .T. and in BeforeRowColumnChange, I replace foreign key with my master key whenever it is empty. The master-detail table is bound together in the data environment and in my gird, the LinkMaster, ChildOrder, RelationalExpr and RecordSource are all set properly. I am using private data session and optimistic buffering.
>>
>>I went down to my user's office for a test today. It seems that while my master key didn't move (I test with a textbox on the form), my grid just suddently got fill up with data with another master key (I placed the foreign key field into one of the columns). I am not talking about a row but sometimes several rows of data. How can this happen? It seems to happen mostly when the other user saves his invoice.
>>
>>I have my save button code below. There are certainly a lot of room for improvement in this code because it was my first VFP project. However, ignoring the bad implementation design, can someone see any problem with this code. Can someone help?
>>
>>
>>*!* In case the user wants running invoice number, invoice number is a regular key
>>lninvid=invmst.invid
>>IF thisformset.addmode=.T.
>> IF EMPTY(thisform.txtInvNo.value)
>> USE parm IN 0
>> SELECT parm
>> lcID=parm.InvNo
>> SET DECIMALS TO 0
>> REPLACE parm.InvNo WITH PADL(VAL(ALLTRIM(lcID))+1,6,'0')
>> thisform.txtInvNo.value=lcID
>> USE
>> ENDIF
>>ENDIF
>>
>>*!* The first two statement should be in the customer class
>>select invmst
>>replace custid with thisform.custid_txt.value
>>if tableupdate(1,.F.,'invdet')=.T.
>> =tableupdate(0,.F.,'invmst')
>>endif
>>
>>*!* StkHist is a transaction history file. Because of the large number of transactions,
>>*!* I have no choice but to save the records for faster access
>>IF thisformset.editmode=.T.
>> select stkhist
>>
>> FLOCK() && added for testing purposes
>>
>> delete all for docno="INV "+ALLTRIM(invmst.invno)
>>ENDIF
>>
>>select invdet
>>scan for invid=thisform.txtinvid.value
>> INSERT INTO stkhist (docdate, docno, source, qty, currcode, ;
>> amtfor, amtsgd, exrate, stkcode) ;
>> VALUES (invmst.inv_date, "INV "+invmst.invno, ;
>> thisform.Custname_txt.value, -invdet.qty, invmst.currcode, ;
>> invdet.price, ROUND(invdet.price*invmst.exrate,3), invmst.exrate, ;
>> invdet.stkcode)
>>endscan
>>select stkhist
>>=tableupdate()
>>UNLOCK && added for testing purposes
>>
>>select invmst
>>thisformset.form1.refresh
>>thisformset.addmode=.F.
>>thisformset.editmode=.F.
>>thisformset.form2.show
>>thisformset.form1.show
>>thisform.hide
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform