>That was it. Wrong file layout
>
>Thanks
Some additional note: the structure of file you get with Copy Structure Extended or the array you get with AFields() is the first thing to vary between versions of Fox. Ever since DBase II it had four fields (name, type, len, decimals); in VFP3 it had some seven or nine, and in VFP5.0 it has some sixteen or so. You should check any routine using these things when moving to a newer version.
Also, there's an ancient bug in all versions of Fox (AFAIK), that a field name may begin with an underscore _only_ if you create it interactively (via Modify Structure), but if you try it using Create [Table | Cursor] < name > ( _something ...) or try to copy its structure using AFields() or Structure Extended table, it will blow up.