Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiuser - Data from another station appear?
Message
From
08/11/1997 00:18:25
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapore
 
 
To
06/11/1997 12:09:07
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00058523
Message ID:
00059046
Views:
35
>>>I am desparately seeking help. My users are jumping all over me.
>>>
>>>I have this strange problem. When I am in network environment, my invoice details sometimes get clobber up with details 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 related 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.
>>>
>>>It seems that while my master key didn't move, my grid just suddently got fill up with a few rows of data of another master key (I placed the foreign key field into one of the columns). It seems to happen mostly when the other user saves his invoice.
>>
>>I am going to assume that when you add a detail row to the grid each row has the same Invoice Number. Do the rows that suddenly appear in your grid have the same Invoice Number as the rows that were originally there? If so your NEWID() function is not working properly with respect to assigning Invoice numbers. If the Numbers are different, are you setting a filter on the table to only display those rows whose Invoice Numbers are equal to the one assigned by NEWID()?
>
>Shih- (is that your first name?)
> To narrow down the problem, take a look in tables themselves to see if records that you think should have certain foreign keys really have the keys you expect. This will ascertain if the problem is with the way the data is stored, or the way you have the form set up.
>On a side note...
>I experienced the same difficulties you are experiencing now when trying to set up my forms with the Linkmaster/childorder etc. properties of grids and relations. While many people use these tools successfully, I never got them to work in some of my more complex forms. (One-to-many-to-many, or two one-to-many relationships) For these more complext forms, I began using parameterized views set to nodataonload on startup. After getting used to this idea, I changed over all of my forms (even the simple ones) and have never regretted it for a minute. I have no relationships in the DE. All of the coordination of cursors is done manually with SEEK and REQUERY() . When all is said and done, the extra code doesn't amount to all that much, and the number of headaches it saves by allowing me to control exactly where the record pointer is and which record the grids are showing children is enormous. People do this both ways, and there are arguments for each, this is just my philosophy (much of
>which I have Edward to thank for).
>
>Erik

Shih Chau is my given name and Tai is my family name. As Tai is a rare family name in Chinese, sometimes, I also ask people who are not used to addressing Chinese name to call me Tai (pronouced just like Thai).

Now back to the question about data from one station appear on another. I simulated it using private data session. It seems to have something to do with refreshing. I put my master surrogated primary key on the form and when I clicked on it, the grid's data got refreshed. If I have a SET (or VIEW in FPW26) window and I cliced on it and back to the form, the grid's data got refreshed also. I don't think it has something to do with the position of the pointer because I won't be moving the pointer by just clicking back and forth between the two windows, right?

I thought I was near to the solution but after one day of testing, I still couldn't find out what is wrong. I suspect it has something to do with the use of 'ALLOWADDNEW' and append blank in BEFOREROWCOLUMNCHANGE or the refresh after the APPEND BLANK. I have tried all sorts of REFRESH or SETFOCUS but no luck so far. I also try to SELECT the master table before I REFRESH, to no avail.

Any suggestion?
Previous
Reply
Map
View

Click here to load this message in the networking platform