Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending records with memo fields
Message
From
10/06/2012 09:28:51
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
08/06/2012 13:43:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01545665
Message ID:
01545752
Views:
49
>>>I am constructing an archive utility. As part of this I require to append fields from an existing dbf to a newly created archive file. The dbf is around 8mb with an associated 5mb fpt file. Even when I mark say only 2 of the records to be archived it seems to take an age to append the records fromt the dbf to the new archive file. On inspecting the archive file I find I have my 2 selected records - but the fpt file has come across in it's entirety (5mb); If I pack the new archive dbf it reduces the fpt to a few k in size. I am presuming the append operation is taking so long because of the size of the original fpt file.
>>>
>>>Is this behaviour normal?
>>>
>>>Thanks
>>>Barry Sutton
>>
>>It depends on exactly what you are doing. I suspect you are doing this:
>>
>>SELECT Archive
>>APPEND FROM existing FOR marked = .T.
>>
>>Best to use SQL to
>>
>>SELECT * FROM existing WHERE marked = .T. INTO CURSOR c_Temp NOFILTER
>>SELECT Archive
>>APPEND FROM DBF('c_Temp')
>
>I wonder whether you get the same speed-up from the all SQL version:
>
>
>INSERT INTO Archive ;
>  SELECT * FROM existing WHERE marked = .T. 
>
>
>I think you would.
>
>Tamar

Hi Tamar

Yes. I usually let the user see the marked records before archiving. Two ways to do that.

1
browse for marked or set filter to marked then grid/browse
select for marked into cursor
append from cursor

2
select for marked into cursor
append from cursor
Previous
Reply
Map
View

Click here to load this message in the networking platform