Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table buffering no longer works (bugs ???)
Message
 
 
To
30/07/2007 10:01:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01244552
Message ID:
01244555
Views:
12
>Hi All,
>
>Excuse my English, hope I can explain this problem clearly. Please bear with me :)
>
>This is someone else's problem. But I think this is a critical problem and it will hit anyone who uses the same scenario (based on native VFP table, One-to-Many Relationship and Table Buffering). I've searched on MS site, can't find any topic regarding this problem. So I post it here and looking for some answer/explanation.
>
>The problem is detected in multi-user environment. In older version (VFP-6/7/8) there were no problem at all (works as advertised). But in VFP9 (with/without SP) seems like Table Buffering no longer works and the relation is broken! A simple REFRESH and/or SETFOCUS does not really solved the problem. It changes the record pointer and causing an ugly effect on the display. I tried several workaround, but none of it works perfectly. Perhaps, I missed some new, simple SETTING ??. Or maybe someone already has a smooth workaround (I hope).
>
>Here is the example and the step to reproduce the problem:
>
>- Open VFP9, run the program (user #1)
>- Move the form to the right side. This has nothing to do with the problem. Only to simulate multi-user environment. So you can see the problem with another user (later) side by side
>- Click on Input button. The focus automatically set to the detail grid
>- Move Up/Down Arrow to make sure there are 4 records in the detail
>- Put the focus back to the third rows and leave this user
>
>- Open another instance of VFP9, run the program (user #2)
>- Click on Input button
>- Click on Save button
>
>- Switch back to user #1
>- Press UpArrow once, what is happening here ???
>- Press UpArrow again, what is happening here ???
>- Now, you are on the top row of the grid. Press UpArrow one more time. What is happening here ???
>
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>*************************************************
>
>DEFINE CLASS form1 AS form
>
>   Top = 0
>   Left = 0
>   Height = 279
>   Width = 357
>   ShowWindow = 2
>   Caption = " ???  Buffering BUGS  ???"
>   nOldRefresh1 = 0
>   nOldRefresh2 = 0
>
>
>   ADD OBJECT command1 AS commandbutton WITH ;
>      Top = 15, Left = 21, ;
>      Height = 27, Width = 49, ;
>      Caption = "Input"
>
>   ADD OBJECT label1 AS label WITH ;
>      Top = 21, Left = 107, ;
>      Height = 17, Width = 62, ;
>      Caption = "Invoice No."
>
>   ADD OBJECT text1 AS textbox WITH ;
>      Top = 17, Left = 173, ;
>      Height = 23, Width = 74, ;
>      ControlSource = "test_header.inv_no"
>
>   ADD OBJECT command2 AS commandbutton WITH ;
>      Top = 15, Left = 288, ;
>      Height = 27, Width = 49, ;
>      Caption = "Save", Enabled = .F.
>
>   ADD OBJECT grddetail AS grid WITH ;
>      Top = 59, Left = 18, ;
>      Height = 200, Width = 320, ;
>      RecordSource = "test_detail"
>
>
>   PROCEDURE Load
>      If !file( 'Test_Header.dbf' )
>         ** Create table for testing (first time only)
>         Create table Test_Header ( Inv_No c(8) Candidate )
>         Create table Test_Detail ( Inv_No c(8), Descript c(20) )
>         Index on Inv_No tag Inv_No
>      endif
>
>      ** Use Top-Level form and Hide VFP main screen
>      ** to see the problem (side by side)
>      _Screen.Visible = .F.
>      ThisForm.nOldRefresh1 = set( 'Refresh' )
>      ThisForm.nOldRefresh2 = set( 'Refresh', 1 )
>      Close databases all
>
>      Set MultiLocks on
>      Set refresh to 0, 90
>      Use Test_Header in 1 shared order 1
>      Use Test_Detail in 0 shared order 1
>      CursorSetProp( 'Buffering', 5, 'Test_Header' )
>      CursorSetProp( 'Buffering', 5, 'Test_Detail' )
>      Set relation to Inv_No into Test_Detail
>   ENDPROC
>
>
>   Procedure Unload
>      Close databases all
>      Set refresh to ThisForm.nOldRefresh1, ThisForm.nOldRefresh2
>      _Screen.Visible = .T.
>   EndProc
>
>
>   Procedure GrdDetail.Init
>      This.Column1.Width = This.Column1.Width + 20
>      This.Column2.Width = This.Column2.Width + 20
>   EndProc
>
>
>   PROCEDURE command1.Click
>      cInvNo = right( Sys( 2015 ), 8 )
>      Insert into Test_Header values ( cInvNo )
>      Insert into Test_Detail values ( cInvNo, cInvNo + ', ' + time() )
>      Insert into Test_Detail values ( cInvNo, cInvNo + ', ' + time() )
>      Insert into Test_Detail values ( cInvNo, cInvNo + ', ' + time() )
>      Insert into Test_Detail values ( cInvNo, cInvNo + ', ' + time() )
>
>      This.Enabled = .F.
>      ThisForm.Command2.Enabled = .T.
>      ThisForm.Refresh()
>      Go -3 in Test_Detail
>      ThisForm.grdDetail.SetFocus()
>   ENDPROC
>
>
>   PROCEDURE command2.Click
>      TableUpdate( .T., .T., 'Test_Header' )
>      TableUpdate( .T., .T., 'Test_Detail' )
>
>      This.Enabled = .F.
>      ThisForm.Command1.Enabled = .T.
>      ThisForm.Refresh()
>      ThisForm.Text1.SetFocus()
>   ENDPROC
>
>ENDDEFINE
>
>
>Can, anyone confirm it? Again, It works perfectly in older version (VFP-6/7/8). No problem at all.
>
>TIA

I don't have VFP9 here to try, but check if http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1866782&SiteID=1 is somehow related to the same problem.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform