OpenFile does not like .txt file


#1

I am attempting to append the contents of a text file to the current database but using OpenFile results in a dialog that states…

“Sorry, only Panorama, OverVUE, or TEXT files can be appended.”

If I use
OpenFile Dialog
and select it as a Text file, it opens a new database and imports fine.

If I use OpenFileDialog, the selected file does not return anything for ‘Type’. is this the cause?


#2

I made a little test here and can confirm: The File Open dialog (via menu) works, the openfile statement seems not to work. You better use the opentextfile statement.


#3

Yes. That is the cause. The OpenFile statement is looking for a type code of “ZEPD” or “TEXT”. File extensions are recognized when you choose from the dialog, but not otherwise.


#4

The openfile statement has to figure out whether the file is a Panorama database or a text file. If it can’t figure it out, it won’t open the file.

If you have a file that you absolutely know is a text file, use the opentextfile statement as Kurt suggested. This statement doesn’t try to figure out what type of file it is, it just takes your word for it that it is a text file. Of course if it isn’t a text file, you might get bad data, or even a crash.