' If the connection is already opened If lConnectionIsAlreadyOpened Then oCommand.Connection = oApp.aConnection(nConnectionString, 2) Else ' Open the connection loConnection = New OdbcConnection(oConnectionOpenManually.cConnectionString) ' Open the connection loConnection.Open() oCommand.Connection = loConnection End IfWhen I trace it, when the connection is not already opened, after loConnection.Open(), it says that the connection state is Open. However, it crashes on the next line saying the "Object reference not found". If it is already opened, what could cause it to generate this error?