Robert Tannahill probably got his title from an old Scots tune, "The Braes of Balquheder" printed as early as 1742 (See Scots tune index on my website for early copies). Robert Burns' song "Ilk care and fear" is printed (chorus first) to the tune in 'The Scots Musical Museum', #193, 1788.
Tannahill's song is in "Pocket Encyclopedia of Scotch, English, and Irish Songs', II, 1818. Four of Tannahill's song are in 'The Little Warbler', 1804, but not this one. However, most of his songs were first printed in magazines, not songbooks. (Before he died in 1810, obviously.)