Find & Open does not work for some databases


#1

The Find & Open … menu command fails to open most of my databases. Instead I am getting the error Database “.pandb” does not exist.


#2

If I understand you correctly, the Find & Open dialog does list your databases, but when you double click on one, it doesn’t open and the error message shown above appears. Is that correct?

In the dialog, it should show two lines for each database. The first line has the database name in bold, with the extension (.pandb) in gray. The second line shows the path to the database in smaller type. Is all that correct?

If you right click on a database name, you’ll see a pop-up menu. If you choose Copy Path to Clipboard, does that show the correct path?

You say that it fails to open most databases – I assume that means that some do open. Can you see any pattern to this – maybe it opens files in some folders but not others, or there is something different about the filenames that don’t open?

By the way, the source code for the Find & Open dialog is available to you – it’s a procedure called FINDOPENDIALOG in the FindOpenLib statement. You can open that with the Open View or View Organizer. It builds the list of databases using Spotlight. Then it simply uses opendatabase to open the database you have selected. Perhaps you have special characters in your filenames that Spotlight isn’t handling correctly? I would assume it is all unicode and would work correctly, but since you are outside the USA, perhaps there is some problem there.


#3

If I understand you correctly, the Find & Open dialog does list your databases, but when you double click on one, it doesn’t open and the error message shown above appears. Is that correct?

Yes.

In the dialog, it should show two lines for each database. The first line has the database name in bold, with the extension (.pandb) in gray. The second line shows the path to the database in smaller type. Is all that correct?

Yes.

You say that it fails to open most databases – I assume that means that some do open. Can you see any pattern to this – maybe it opens files in some folders but not others, or there is something different about the filenames that don’t open?

Yesterday many more of my databases were failing, but I was not able to see any scheme.

Today, after reading your post, I did some more testing, and accidentally I tried to resize the F&O window. The wizard seemed to (sort of) „refresh“, and since that moment most of my databases open successfully that failed yesterday.

If you right click on a database name, you’ll see a pop-up menu. If you choose Copy Path to Clipboard, does that show the correct path?

Yes, with one exception: I have some folders named according to soccer seasons e.g. „2016-17“. These are displayed (and handled) by the Find & Open wizard as „2016:17“, and these databases are not found.

By the way, the source code for the Find & Open dialog is available to you – it’s a procedure called FINDOPENDIALOG in the FindOpenLib statement. You can open that with the Open View or View Organizer. It builds the list of databases using Spotlight. Then it simply uses opendatabaseto open the database you have selected. Perhaps you have special characters in your filenames that Spotlight isn’t handling correctly? I would assume it is all unicode and would work correctly, but since you are outside the USA, perhaps there is some problem there.

Thank you!
Kurt


#4

Now the issue hit me again. The database name is displayed O.K. as well as the file path, but when I try to copy the path, the clipboard remains empty. The same error message appears again, showing the missing database name.

This applies to different databases in different folders — no common factors, no exotic characters.

But now, some minutes later, it seems to work again. Maybe the issue depends on what window is active when the wizard is opened? I see in the code that there is a variable waswindow.

I can reproduce the error when I use Find & Open … with no database open.
I can avoid the error when I already have a database open and then use Find & Open … for the 1st time.


#5

I have to correct that: The folder names did not contain hyphens, they contained slashes e.g. 2016/17. Those slashes were converted to colons -> 2016:17.

So the solution is easy: I am going to replace the slashes in the folder names with hyphens now. — Problem solved.


#6

I’m having the same issue with (as far as I can tell) just one database. Using Find & Open, if I right-click and select “Open Data Sheet Only” I get the error message. If I instead select “Open With No Windows” nothing at all happens - no error, no file opened in any way. This happens whether it is the first file I’m trying to open or not. The correct path is shown in the dialog, but “Copy Path to Clipboard” yields nothing, while with other files it works as expected*. It used to work with this file, don’t know if the latest update broke something. Rebooting makes no difference, this has been happening for several days. I am able to open my file (data sheet only) using “openplain” executed from another database, but F & O is so much more straightforward. The file name has no special characters except for some spaces, like my other files.

I need to do this because the .Initialize procedure for this file has a lot of problems due to Pan 6 -> Pan X incompatibilities, so I bypass it this way so I can work on forms and procedures. Opening it the regular way just causes problems.

*The fact that no path is copied is probably a big clue. Is there a way to refresh what the F & O dialog has to work with?


#7

A quick workaround is to rename your .Initialize procedure until the problems are resolved.


#8

I had that exact thought as I typed my post. That’s a good solution for my current problem, but being able to do this as needed is still a plus.


#9

I think I’ve narrowed it down. My F & O dialog is set to “recent”, and the file that’s giving me trouble is at the top of the list because I’ve been working on it a lot. If I set it to “alphabetical”, an entirely different file is at the top of the list, and it has the same problem. And while it is “alphabetical” my original problem file is well down the list, and now it performs normally. So it appears to be that being at the top of the list causes the problem.


#10

I can confirm this. There seems to be a bug that affects the topmost file in the Find & Open dialog.


#11

I’ve added this to Bitbucket:

It turns out, if you click on another file, and then back to the first file, it works. However, the originally selected file doesn’t initially work. Thanks for the detailed info, it should help in pinning this down.


#12

I found that by changing the Spotlight mini-procedure of the FINDOPENDIALOG procedure in the _FindOpenLib file fixes the problem. It seems the selectDatabase variable is not being automatically set when the Find & Open Database window is created. This change forces it to initialize correctly as well as re-initializing it if the Alphabetic option is selected. Here is the change I made:

selectedDatabase=array(databaseList,1,cr())
showvariables databaseList, selectedDatabase
rtn

Still it seems to be a bug that the variable linked to the MatrixObject is not set when initialized.


#13

Thanks Gary!


#14

Jim, in case you might be interested, I made a little tweek to the TextDisplayObject in the ViewFrame for the ViewMatrix so that it shows all open files in violet instead of black. I changed the formula to:

richtextdisplay(?(arraycontains(info("files"), arrayrange(filename(info("matrixcelldata")),1,arraysize(filename(info("matrixcelldata")),","),"."), cr()),"<color:800080>"+arrayrange(filename(info("matrixcelldata")),1,arraysize(filename(info("matrixcelldata")),","),"."),"<color:000000>"+arrayrange(filename(info("matrixcelldata")),1,arraysize(filename(info("matrixcelldata")),","),"."))+"<color:666666>."+fileextension(info("matrixcelldata")))


#15

Wow, cool idea!


#16

Find & Open still has problems. I am trying to test something by opening one single thing at a time, from a fresh start. I’m using F&O because I want to open just a particular data sheet to start with. I start Panorama, and of course the Untitled empty database opens with it. In order to “do things one at a time” I close the empty database first. Find & Open starts out seeming to work normally, except that after I have right-clicked on the database I want and select Data Sheet Only, nothing happens. The dialog closes, and my screen remains blank. Wondering if it just opened it with no windows instead, I check Memory Usage to see if Pan thinks there is a database loaded. Nothing at all. Here is one of the strange parts - when I close the Memory Usage dialog, up pops the first file in the Find & Open list (sorted alphabetically); the one I’m after is the 5th in the list. This is repeatable, but I can’t tell if that file came up simply after a time delay, or it was tied to closing the Mem Usage box.

If I leave the empty database open, then use F & O, it works like I need it to. If at this point I close both databases, leaving nothing open, using F & O fails the same way again.


#17

The fact that Panorama X doesn’t work correctly if no windows are open is a long standing problem that I certainly have never claimed was fixed, in spite of a lot of time being spent trying to figure out what the problem is.