Accessing a file previously opened as secret


#1

When i use this sort of code to extract data from a file opened as secret,

opensecret "Customers"
window "Customers:Secret"
arraybuild jdAlpha,cr(),"",FirstName +" "+ LastName
closewindow

I can no longer open the file by double-clicking on it. Presumably, it’s still secret. I can open it with a procedure.

How do I un-secret it programmatically?


#2

You could use the setactivedatabase statement something like:

opensecret "Customers"
setactivedatabase "Customers"
arraybuild jdAlpha,cr(),"",FirstName +" "+ LastName
setactivedatabase ""

And later if you want to go to the secret database’s datasheet or some other form:

setactivedatabase "Customers"
opensheet

That should open the secret database’s datasheet and make it the active database.


#3

I think this may be what you are looking for:

Also, your first procedure probably doesn’t do what you think. You can’t use closewindow to close a secret window – that is actually going to close whatever the topmost visible window is. Probably best to forget about secret windows and just use setactivedatabase. It’s actually the same thing as far as how it works internally, but I think clearer to understand.

Also note that if you want to open a form in a secret database, you can now do so with openform, without having to use a secret window or the setactivedatabase statement. Here’s how you would do that with your secret “Customers” database.

openform "form name","database","Customers"

To open the data sheet, use the code Gary provided.


#4

I can’t make any of these techniques work. When my .Initialize procedure opens Customers as a secret file, I can’t open it manually.

I suppose I can just do openfile and closefile but thats a bit counter-productive.


#5

I think Michael’s request has been misunderstood. I think for files he’d already opened secretly, ie. without windows, in his .Initialize procedure, he had been using the Finder, essentially, as a “window launcher.” In Panorama6, when a database is already open without windows as “secret,” having the Finder “open” (by double-clicking the file or any other Finder method) that database results in opening its normal window(s). In PanoramaX doing the same leaves the database open (you can see it listed at Memory Usage…) but doesn’t open the windows.

Michael seems to have found the Panorama6 behavior useful and misses it. Off the top of my head I can’t think of how to restore it, but maybe something clever can be added to his .Initialize to restore it.