Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 Tags
Subject: RE: COPY TO [file] nullifies field value
Thread ID: 395961 Message ID: 395973 # Views: 49 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Wednesday, January 22, 2014 1:11:30 AM         
   


> Colleagues,
>
> I've never seen such behavior: some fields are nullified upon a cursor's being saved into a DBF file on disk!
> Here's what's going on:
> I have a cursor, populated in the code (with INSERT INTO C_CURSOR FROM MEMVAR) in a cycle;
> I set a STEP ON after the end of that cycle to check the contents of one particular field;
> Checking this field (numeric) after cycle's completed - the value is correct (non-zero);
> Some additions to this cursor (client's store's attributes) in the code, check this field again - the value is still correct (non-zero);
> I COPY TO (SomePath\C_COPY.DBF), checking this field again (right after that command) - bloody hell, it's Zero! :-@
> As well as couple other fields that weren't zero in the cursor before copying it into a DBF! :-@:-@
>
> Here's the actual code:
>
>
***** Debug *****
> IF _VFP.StartMode==0
>    SET STEP ON
> ENDIF
> *****************
> SELECT CO_STATE && Just in case
> ** Preserve the resulting cursor
> COPY TO (m.gcCompanyPath + [CO_STATE.DBF]) ALL

> Whatever I tried - the result was the same: this particular field turns to zero at the moment it's been copied into a DBF file on disk.
>
> Any idea why this might be happening, and how I can fix it?
>
> AHWBGA!
>
> Regards,
>
> Ilya


Hi Ilya,

I assume you already tested fully:
- Use the Co_State.dbf and copy stru to another .dbf then append records back into
the copied version of your dbf and rename it just to rule out any original table issue.
- Ensured you target another folder on your computer like C:\User\YourUserID\Documents
just to 100% rule out some flaky write permission issue.
- Ensure you recreated and .cdx by physically deleting them and recreating them and
pack and reindex.

I only bring these points up as I am kind of grasping at straws here. I personally have
never experiences this behavior so really do not know what the root cause would be?

If buffering were set on then all field values would not be changed without the tableupdate()
but you are advising most fields are changing and only a few are changing back to zero.

Pete "the IceMan", from the Great White North of Canada.
www.marathongriffincomputers.com

ENTIRE THREAD

COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/21/2014 10:01:40 PM
RE: COPY TO [file] nullifies field value Posted by Ali Koumaiha @ 1/21/2014 10:29:37 PM
RE: COPY TO [file] nullifies field value Posted by Ali Koumaiha @ 1/21/2014 10:30:22 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/21/2014 10:47:41 PM
RE: COPY TO [file] nullifies field value Posted by Pete Sass @ 1/22/2014 1:11:30 AM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/22/2014 4:51:28 PM
RE: COPY TO [file] nullifies field value Posted by Pete Sass @ 1/22/2014 6:56:30 PM
RE: COPY TO [file] nullifies field value Posted by Tore Bleken @ 1/22/2014 11:35:59 AM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/22/2014 4:46:38 PM
RE: COPY TO [file] nullifies field value Posted by Rick C. Hodgin @ 1/22/2014 5:32:21 PM
RE: COPY TO [file] nullifies field value Posted by Pete Sass @ 1/22/2014 6:53:42 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/22/2014 7:38:46 PM
RE: COPY TO [file] nullifies field value Posted by Gene Wirchenko @ 1/22/2014 8:02:19 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/22/2014 8:13:59 PM
RE: COPY TO [file] nullifies field value Posted by Gene Wirchenko @ 1/23/2014 7:27:13 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/23/2014 10:42:08 PM
RE: COPY TO [file] nullifies field value Posted by Gene Wirchenko @ 1/24/2014 8:07:43 PM
RE: COPY TO [file] nullifies field value Posted by Tore Bleken @ 1/24/2014 8:43:37 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/24/2014 8:54:55 PM
RE: COPY TO [file] nullifies field value Posted by Tore Bleken @ 1/24/2014 11:24:07 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/24/2014 8:44:14 PM
RE: COPY TO [file] nullifies field value Posted by Pete Sass @ 1/22/2014 9:08:35 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/22/2014 11:47:25 PM
RE: COPY TO [file] nullifies field value Posted by Rick C. Hodgin @ 1/22/2014 9:46:21 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/22/2014 11:53:11 PM
RE: COPY TO [file] nullifies field value Posted by Vilhelm-Ion Praisach @ 1/22/2014 5:36:06 PM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/22/2014 7:31:26 PM
RE: COPY TO [file] nullifies field value Posted by Vilhelm-Ion Praisach @ 1/22/2014 8:02:21 PM
RE: COPY TO [file] nullifies field value Posted by Jun Tangunan @ 1/23/2014 4:33:59 AM
RE: COPY TO [file] nullifies field value Posted by Ilya Rabyy @ 1/23/2014 7:22:11 PM