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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command is not supported for views 1

Status
Not open for further replies.

Kurt4443

MIS
Mar 3, 2017
4
US
Hello.
My problem is when opening .dbf format file in Visual FoxPro i am receiving an error message,
This command is not supported for views

Anyone have an idea what might be causing this? How to open dbf file?

Thanks
 
I don't know why you are using CPDBF(). The correct command to use is USE.

So, if the table is c:\data\customers.dbf you would execute:

[tt]USE c:\data\customers[/tt]

Give it a try.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I think he uses CPDBF() on a workarea name of a view. There is no use for USE here, as there is no use for CPDBF(). You [highlight #FCE94F]just BROWSE[/highlight] the workarea, when it's already open. If there is a codepage problem with the data/text you see, find out the table(s) the view queries, but don't act on the view workarea with CPDBF, act on the table(s) workarea(s).

Look at CURSORGETPROP("SQL"), it'll tell which query generated the workarea data.

Bye, Olaf.
 
Olaf said:
I think he uses CPDBF() on a workarea name of a view.

You might be right, Olaf. But his question was expllcitly: How to open dbf file? - Even though the error message specifically referred to views. All very confusing.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yes, and CPDBF has parameter workarea/alias only, not dbf file. So when CPDBF() is used, the dbf file is already opened in a workarea via USE or doubleclick starting VFP opening the dbf or via dataenvironment or any other way, CPDBF acts on a dbf file open in a workarea. Kurt (in my interpretation) confuses workareas with files. Even if workareas reflect 1:1 dbf files, they are alreaedy opened, when you use CPDBF():
And CPDBF only is appicable to workareas having a dbf open in them. So Kurt hasn't understood the file is already open, when showing up in a dbf. What he used to get this workarea populated is a view, judging by the error message. And a view is no dbf, it is a query on dbfs, so it has no own codepage, the table files it is querying have a codepage. And last not least CPDBF is just about showing/changing the codepage of a dbf, it is not for showing or opening a dbf at all.

So Kurt, while this may all be very confusing, you should simply read a bit about foxpro before making false assumptions. You already got pointers what commands really act on files. USE can open both a dbf file directly, but also any object of a currently open DBC, including views, though they themselves are no files.

Bye, Olaf.
 
According to the DBF Open File website:

DBF Open File Tool offers an easy way to open a corrupt .dbf file

You never said anything about your DBF being corrupted. If you had, you would have got an answer very much quicker, and saved us all a lot of time and effort.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I still think Kurt just wanted to BROWSE the data and CPDBF was only involved, because of codepage mismatches, ie DBFs having DOS codepage, while VFP9 works in Windows Codepages. Still you can only apply code page chnages to DBFs and not to Views. Views will automatically "mend", once the DBFs they query are converted, they themselves don't support and don't need CPDBF().

In that case the full blown VFP IDE is just a hurdle to getting at the core functionality and a DBF Viewer Tool might help best.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top