code works with debugger, fails without

If I step thru my code with the debugger, it gets the recordset and displays the listbox. If I run without the debugger, I do not get an error and I do not get my window with the listbox. Please suggest debugging techniques.

please post the error and some code surrounding where you believe the error occurs…

If this is a database related issue, how are you referring to the location of the database?
If you are placing the database “near the app/exe” at runtime, this could be part of the problem.
The location of what is “running” when in debugger, and when it is compiled are not the same place.

For the past 3 months or so, we have been having TimeOut issues with our xojo applications. We try to login to our applications and we get a timeout. We immediately try again and we get in and run without error. This is code that has been in place for years so I haven’t thought the problem was in the code. But no one is able to find a problem elsewhere. So I am trying to get a small application together in which to reproduce the problem. I don’t know if what I am encountering is related.

My initial post today is not quite correct. 1/10 attempts to run without the debugger results in a window with a listbox. But most times there is no error…i just do not get a window.

The code is too spaghetti-like to post and be helpful, I think.

I am not sure what you mean by "If you are placing the database “near the app/exe” at runtime, this could be part of the problem. The location of what is “running” when in debugger, and when it is compiled are not the same place. " Could you explain a little more about that or refer me to any other articles? Are you talking about the location on disk of the executing code?

You still haven’t provided us with any information to help you. You’ve basically said: “My app used to work, and now it doesn’t. Tell me why.”

You need to tell us what’s going on, and how you’re attempting to do it. Spaghetti code is also another reason you could be having issues. If you can’t provide us details here we can’t help you :frowning:

OK I understand. Rewriting the applications has been mentioned more than once. Probably not with Xojo though.

Try adding g a menu item for location of database and then add this code to be run when that menu item is activated
(changing ‘MyDBFile’ for your own variable that holds the name of the database file)

MsgBox("Database path is " + PatientListWindow.MyDBFile.NativePath)
Return True

This will show the different locations of the database depending on whether you are running in debugger or a compiled app.

If you have altered the database table structure in some way, and the database already exists, you will get strange errors.

I recommend Dave S’s (https://forum.xojo.com/member/120490-dave-s ) application “tadpole” for modifying the database and tables if it already exists and you don’t want to start from a fresh database.