Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Records Between Tables
Message
From
27/11/1998 05:04:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/11/1998 16:16:54
Thierry Yuen
Stantec Architecture Ltd.
Calgary, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00161609
Message ID:
00161906
Views:
26
>Great. I've worked your code into the material that I have, Cetin, and it works very well. I've gone ahead and created a browse of the information and that isn't working quite well yet, but it's almost there. If you have any suggestoins, please let me know. I know that you've already given me more help than I would have ever expected, but these problems appear to be quite trivial to you. ;) After I close the browse, I get an error saying that 'no table is in use'. Here it is and thanks for the help:
>
>scatter memvar memo
>insert into (m_proj+"PA") from memvar
>skip
>show gets
>close data
>use (m_proj+"PA") alias PA
>sele PA
>go bottom
>browse
>close data
>use (m_proj+"SP") alias SP in 0
>sele SP
>skip
>show gets
Thierry,
I think it's not just this part of code causing the error. Seems you have controls referring to other tables on screen. When you "close data" and call "show gets" (it's the point of error I think) it would complain as "no table is in use" or similar.
In code, what does first "skip" and "show gets" do ? Seems to me useless there because an immediate "close data" follows. Further, after insert into (m.proj+"PA") is opened if not already. Why "close data" and then use it ? I advise not to use "close data" so often. Generally leave it to cleanup of screen. With the existence of structural indexes (cdx) you have plenty space for file handles, instead of close data, you could just "flush" or "set autosave on" if you're doing this against data corruption (set autosave is less safe then flush). If you're doing it to switch the tables then just call -use (m.proj+"PA") in "PA" alias "PA"-. Now after all these I would code it like :
scatter memvar memo
insert into (m_proj+"PA") from memvar
skip           && skip where ?
show gets
*close data    && if immediate close data 
               && although "show gets" would show new data
               && till next refresh - I'm not sure w/o full code
               && Later Browse would provide the user a chance to refresh
               && data via ie:menu 
               && thus might cause an error there
use in (m_proj+"PA") && Close just (m_proj+"PA")
if used("PA")
 use (m_proj+"PA") in "PA" alias "PA"
else
 use (m_proj+"PA") in 0 alias "PA"
endif  && Just for readabilty instead of iif()
* use (m_proj+"PA") in iif(used("PA"),"PA",0) alias "PA"

sele PA
go bottom
browse
*close data
use (m_proj+"SP") alias SP in 0
sele SP
skip      && Really skip to second rec here ?
show gets
Well afterall, keep in mind, touching partial code might mess up things worse :) Just try to do it w/o close data on the fly.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform