We report a novel approach to ultrahigh quality factor ( $Q$ ) in the split-ring resonator with an active feedback loop, which utilizes a phase shifter to tune equivalent negative resistance for accurate loss compensation. Based on the proposed technique, a microwave detector is designed for on-column liquid chromatography. With lossy solvents loaded, the measured $Q$ is as high as $4.0\times 10^{6}$ at ~ 3.89 GHz. We demonstrate the highly sensitive and contactless measurement of glucose–water solution in a capillary tube under stop–flow and plug–unplug modes, respectively. With the stop–flow mode, different concentrations between 40 and 150 mg/dL are measured, which covers the normal blood-glucose levels. The minimum detectable quantity of glucose is ~18.8 ng with an effective sample volume of ~47 nL. The plug–unplug mode provides fast and flexible sampling and analysis. Further investigations are required for quantification of material-under-test permittivity and promotion of sensitivity.