General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
I have more information since I posted this:
1) The only reason I didn't get the dialog box described below, when opening the view, was because I had a set path statement in effect for the path to where the free table was. Without the path statement, 'use v_ordrfile', always prompts me for the base table.
2) In reviewing other threads here, it appears that sourcename, when applied to a view, gives the ALIAS of the view, not the path
3) When looking at the dbc directly, for the record for the view, I can't find anywhere that vfp stores the path to the base table. I am inclined to believe that it doesn't, at all, and that therefore, the only way I can get this to work is to have a set path statement in place, which is not ideal, but I guess it will have to do.
If anyone can shed any further light on this it would be appreciated.
>I created a view, v_ordrfile, based upon a free table, ordrfile. I used the 'other' button in the view editor dialog box to specify the table and path. BTW, the ordrfile table is not in the same folder as my dbc.
>
>Immediately after I created the view, I issued the command 'use v_ordrfile' from the command window. The view opened up. The I did some other operations (not sure what). Then I attempted the same command, 'use v_ordrfile'. However, this time, a dialog box came up, with a list of tables in the dbc, and an 'other' button. I chose the other button, and it let me choose my free table again. Thereafter, when I issued 'use v_ordrfile', I did not get the dialog box again.
>
>It seems as if VFP was confused (or at least I am confused!) about what the path is to the free table. What property of dbgetprop()/setprop(), or cursorgetprop()/setprop() ?? can be queried/set regarding the path.
>
>?dbgetprop('v_ordrfile','view','tables') returns 'ordrfile' with no path.
>
>?dbgetprop('v_ordrfile','view','sql') returns a sql statement that has no path specified in the from clause, it is just 'from ordrfile'.
>
>?cursorgetprop('sourcename','v_ordrfile') returns 'v_ordrfile'
>
>I would think based upon the vfp help, that sourcename would have the full path to the table, but it doesn't.
>
>The vfp help for cursorgetprop says:
>
>Database C The name of the database in which the table or view is contained. If a table is a free table, contains the empty string.
>Read-Only.
>
>SourceName C Contains the long name for a SQL view or a table in a database, or the file path and table name for a free table.
>Read-Only.
>
>I am building this view in a test environment. I need to be able to change the path to the free table at runtime.
>
>TIA
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only