The simplest method would be to set logpass to empty string right after the CONNECT statement. You could encrypt it into a global variable in case you needed to connect again later.
The issue I see with this question is that the user typing in the password and the hacker are the same person so of course they recognize the password in the memory dump. A real hacker isn't going to recognize that string as a password or have knowledge about the internals of PowerBuilder or your app.
If you have a hacker in your network looking for passwords, installing a key logger would be easier than looking at memory dumps. To avoid a key logger, you'd have to use Windows Authentication or whatever Oracle calls it.
To avoid hackers you need to first make sure your network is secured and all users are well trained in how to avoid the hacker tricks.
With all our tests, we can now confirm that the transaction object used to connect is kept into memory, even if change it after CONNECT. Very bad news.
I think you're missing the point here. What Roland says is more important than the information remaining in memory. Physical security of the machines, and prevention of virii/trojans/malware, is just as important as keeping memory clean.
When a user inputs a password (or any other "important" information), it will always exist somewhere in memory. That can't be bypassed, ever. The situation you're describing, of having a password lay in memory, is always going to occur at some point. The fact that it's not immediately cleared after the connect isn't anything out of the ordinary.
Since you know what you're looking for in memory, how hard would it be to find the same information for a scanning program? Does anything around the password indicate that it's a password field? Is the memory formatted in some specific way that makes it obvious that it's a password?
As long as there's a chance of foreign software being run on the PC, you'll always have the possibility of a password being stolen. It doesn't have to lay in memory for it to happen; a keylogger, windows input field scraper, tcpip scanner, etc. are all ways to snag data that are just as dangerous as a memory scanner.