I have a connect string that I am attempting to use in VB to connect only if I do not currently have a connection active. This is the code:
If NotificationsConn.State = 0 Then
SQLString = "Data Source=DSource;UID=UserID;PWD=password"
NotificationsCmd.ActiveConnection = SQLString
The problem with this code is that it creates a connection to the database every time it is run, even if there is already a connection present. What am I doing wrong? Thanks very much.