Connect to Server error

Yesterday when I chose “Connect to Server” from the File menu, I received the message “Wait for task statement can not wait”. I’ve seen this several times in the past, but I’m just getting around to reporting it.

I also just had my first experience where I had to insert a message in a procedure as I was getting an error that should not have occurred. When I put in a Wait 0 (which I know I’m not supposed to have to do) the procedure worked perfectly. If Wait 0 should never be used, I would be pleased to know what a better alternative would be to resolve Panorama not being able to keep up with the code in a procedure.

Do you remember what you had done earlier with that particular database? That message indicates that Panorama thinks a previous operation did not complete.

Since you’ve given no information about what the code in question was, what the error was, or what the context of this code was (how was it triggered, etc.), no alternative suggestions can be provided.

No one said you’re not supposed to ever use the wait 0 statement, it’s a great statement that is very useful in specific situations. These situations are covered in this help page and in the video session from last year of the same name.

Unfortunately, I don’t remember. It pops up every few days. I’ll see if I can keep a closer eye on when.

In a thread awhile back someone said that they used wait 0 to force Panorama to catch its breath (my paraphrasing). At that time you said it was not a proper way to use wait 0 and I believe you mentioned the run loop at that time. I have found, as have others, that sometimes you need to pause a procedure before it will run correctly. In this case a lookup( was returning false when it was always true. Putting the wait 0 before the lookup( made it return true.

Ok, but was was the code before the wait statement? Also how is the code being triggered, and tell me about the database that is being looked up from.

Perhaps you are running into the problem that Michael ran into – there is a bug if you close a database and then immediately re-open it.

Both databases are open. The code before the lookup is loading a variable with a field name. That variable is used in the lookup( to match a key field in the other open database to see if an item is in stock (a field text field that states in stock or sold).If the item is in stock, it is added to an invoice. If it is not in stock, the user is asked if they want to add it anyway. Without the wait 0, an item is never seen as being in stock, even if it is.

Is there a secret window involved? If so, the wait 0 will end that and go back to the actual visible window. That could account for the change in behavior. It’s definitely not because of any time delay involved.

No secret window. Both databases are fully open.

As you know, I am converting a few solutions I did not create. I just realized this procedure is writing a file to a folder just before loading the variable and doing the lookup. When I commented that out, the lookup worked. So???

I grow weary of this “twenty questions” guessing game. You have the code in front of you, we here on the forum do not. If I did have the code in front of me, I would liberally sprinkle the code with zlog statements so that I could see exactly what was happening every step of the way. If necessary, I would add a zlog statement after every single statement.

Is there a method to determine if there is an open session from a shared file to the server?

I am only finding the ability to determine if there is a connection (via a Ping).

You can turn on logging on the server and see when a client opens a session, closes a session, and lots of other in between stuff. You can watch the log as clients do things to see them reflected in the log.

Is that what you are hoping to find out?

I am hoping for a Statement or Function that will allow me to know if I have an open session. If my session has been interrupted, I can DropServer, ConnectToServer.

At this time, if my session has been interrupted, I get errors. I then have to manually Disconnect from Server, then Connect to Server. I’d like to automate that instead of getting errors.

I have written up your hopes as a formal proposal.

1 Like