Show a splash screen while a database connection (that might take a long time) runs?

Because of the known limitation that every thread must use it's own ADO connection (ie you cannot use a connection object created in other thread), the only option I can think of is create a thread that will make a connection to database, and, after the connection is established or timeout is reached, signal the main thread about the event and close/destroy the connection. The main thread can in the meantime display splash or progress, waiting for a message from that thread. So, you eliminate the case with wrong password or unreachable host.

There is a reasonable assumption, that, if the second thread could connect, the main thread would be able to connect right after.

There are several methods for inter-thread communication. I usually use Window's messages. First I define custome message and message handler in a form.

Then when I need to inform main thread from custom thread, I use PostMessage function to send notification.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions