Why is file extension not permitted in the importdatabase statement?

I remain utterly confused by the question of when and when not to append the .pandb extension to a file name in a stat/func.

For example, if I include the extension within the importdatabase statement, I get an error message saying that the incoming file isn’t open, even though it is, because I’ve specified the name incorrectly…

Is there a simple, understandable rule? Failing that, is it possible to compile a list of where the extension is needed and where it’s verboten?

If you are referencing the disk file, use extension. If the file is already open in memory, don’t use extension. :wink:

1 Like

Bill has pretty much encapsulated the basic rule. You should be ok if you follow this rule.

There are some situations where you can reference the disk file with or without the extension. For example, the opendatabase statement will assume that you are referring to a .pandb file if no extensions is provided. But if that’s too hard to remember, just include .pandb (because the file is on disk, not in memory) and don’t worry about it.

In the case of the importdatabase statement – that is referring to a database in memory, so you do NOT specify the extension.

Couldn’t be simpler - thank you both.

This has been driving me mad too, thank you all three.