' Different backends handle it differently Select Case nSQLMode ' OleDb Case 1 nResult = oDataAdapter.SelectCommand.ExecuteNonQuery() ' If the connection was not already opened If Not lConnectionIsAlreadyOpened Then ' Close the connection oCommand.Connection.Close() End If ' SQLClient Case 2 Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1)) loSQLConnection.Open() oCommand.Connection = loSQLConnection nResult = oDataAdapter.SelectCommand.ExecuteNonQuery() End Using ' ODBC Case 3 nResult = oDataAdapter.SelectCommand.ExecuteNonQuery() End Select