Hmmm... but that's an alias. You are not using a view out of a database.
Maybe that's the difference. Or it could be that I have set the TMPFILES
term in my config.fpw like this:
TMPFILES=C:\TEMP
So you created an alias like this?
USE mytable ALIAS myalias
If so, dbf() should have returned your table name...
At any rate as I mentioned I'm using a parameterized view in a database. For
example let's call it myview. I suppose I could write some code to create
one but if you have a database with a parameterized view, set your variable
and use it like this:
lctheparameter = "parameter"
USE mydatabase!v_myview
SELECT * from DBF("v_myview")
This will bring up the open dialog when I execute this code.
Now, you mentioned Create Cursor and that inspired me to write this, which
does replicate the error:
CREATE CURSOR mytable (somefield c(10))
INSERT INTO mytable (somefield) VALUES ("test1")
SELECT * from DBF("mytable")
So you may be asking "Why does this dude want to select from the temp file,
why not just write
SELECT * from v_myview
and call it good?"
Let's say you buffer the view, and changes get made but they are not updated
using TABLEUPDATE. If you SELECT from the view name like I have above, you
will not see any un-saved changes as VFP appears to do a USE AGAIN and
selects from a new instance of the view. In fact, I think this is documented
in the KB and this method is the suggested workaround. I'll be darned if I
can find that article though...
I have worked around it by using copy to array and other commands, but it
would be easier and much more powerful if you could SELECT from a open,
buffered view. I suppose I could always report it if I go to the trouble of
coding it... unless they fixed this in 9.0 or there is some command or
method I don't know about. I'm using 8.0, btw.
Thanks for the chat!
- Ron
Post by Josh AssingCan you provide code that replicates it?
I just created an alias -- and did a select from dbf("MyAlias")
the file it refers to does not exist (no big suprise here) -- and the select
worked fine...
What VFP? an d code to replicate it would be handy... (Create cursor)
becuase my steps worked w/o error.
Post by Ron WeldyI simplified it while testing with the view open and executed it in the
SELECT * from DBF("v_myview")
A straight DBF("v_myview") will return a file name of
c:\temp\J2GO003U.TMP,
but this file does not exist when looking at the temp folder. I also did a
search using windows explorer but could not find the file.
Post by Josh Assingwhat is your statement?
Post by Ron WeldyI am trying to SELECT from an open view using the DBF() function and it
errors saying 'table does not exist'. Interestingly enough, when I look for
the tmp file name that DBF() returns, I can't find it either. Anyone know
what's going on or how to do this?
---
Remove x's to send.
---
Remove x's to send.