How do you retry connecting to database?
I have an application that connects to a SQL server all day long and retrieves information from it ever 30 seconds, but if that SQL server is ever shut down for any reason then my application crashes at the code below and I have to manually restart it.
Does anyone have any suggestions? I would like to see it go into a reestablish connection mode every 20 seconds until it reconnects, but do not know if this is possible.
Code:
Set wFrmRS = wFrmConn.Execute("SELECT Field1 FROM Table1 WHERE Field1 = MyNumericValue")