Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ZAP and exclusivity
Message
From
16/05/2000 13:12:35
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00369979
Message ID:
00369998
Views:
27
>I've read through the archives trying to find a solution to my problem. I've seen several messages that seem like they should have addressed my problem, but nothing seems to work.
>
>I'm trying to ZAP a table. The only way I could get to work was to close my two free tables, reopen them exclusive and then ZAP the one in quesiton (I had SET EXCLUSIVE ON statements all over the place but they did not seem to work). However, after the ZAP when the screen is repainted one of my two grids (the one holding the table that is NOT ZAPped) is blanked out. No grid, no columns, just a big white box. The other grid looks fine. The table is cleaned out and it refreshes to look like it should. Here is my code:
>
>lcSameSource = Thisform.grdDataTable.RecordSource
>
>CLOSE TABLES
>use /data/cross.dbf EXCLUSIVE
>use /data/outtable.dbf EXCLUSIVE
>
>Thisform.grdDataTable.RecordSource = lcSameSource
>
>lcRecordSource = Thisform.grdOutTable.RecordSource
>Thisform.grdOutTable.RecordSource = ""
>ZAP in outtable
>Thisform.grdOutTable.RecordSource = lcRecordSource
>
>I thought maybe by "resetting" grdDataTables RecordSource (this would be the blanked out grid) that it would refresh properly, but it does not.
>
>any ideas?
>
>TIA

I think that when you CLOSE TABLES you rip the record sources from underneath the grids and they go spastic. You might try doing some of the operations in a different order and see how it works out:

THISFORM.LOCKSCREEN = .T.
lcSameSource = Thisform.grdDataTable.RecordSource
lcRecordSource = Thisform.grdOutTable.RecordSource
Thisform.grdOutTable.RecordSource = ""
Thisform.grdDataTable.RecordSource = ""

CLOSE TABLES
use /data/cross.dbf EXCLUSIVE
use /data/outtable.dbf EXCLUSIVE
ZAP in outtable
* ZAP the other one if needed

CLOSE TABLES
use /data/cross.dbf
use /data/outtable.dbf

Thisform.grdDataTable.RecordSource = lcSameSource
Thisform.grdOutTable.RecordSource = lcRecordSource
THISFORM.LOCKSCREEN = .F.

Might need some tweaking depending on your scenario. Depending on whether relations are set, etc. I don't know if you need to shut down both tables but essentially you need to remove the RecordSource(s) from the grid(s) before ZaPping, etc., then restoring the RecordSource(s) etc.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform