Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Has vfp9 changed?

Status
Not open for further replies.

Bertiethedog

Programmer
Feb 8, 2007
118
GB
a code snippet that I find very usefull but no longer works

use table1 in 0 alias table1
select table1
afields(fieldarray)

*-* this works
create cursor xyz from array fieldarray

*-* this doesn't
create table xyz from array fieldarray

It certainly used to work

Richard
 
The error that I am getting is "The name table1 is already used for another object. Please choose a different name"

I am trying to create xyz

I have opened the database, if I use copy stru to xyz I get a free table and a lot of the field names have been truncated
 
Thanks mike but its not using the long field names in the resultant table


Rich
 
Hi Richard,

its not using the long field names in the resultant table

That's because the table you are creating is a free table.

If you want to preserve the long field names, the new table will have to reside in a database. To do that, modify Mike Y's code, as follows:

Code:
SELECT * FROM Table1 WHERE .F. INTO TABLE NewTable ;
  DATABASE MyDatabase

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Everyone I can see the workaround but a lot of my legacy code is going to fail.

Thanks

Rich

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top