What is the longest effective range artillery weapon ever built, regardless of wether it was actually used in combat?
It may be the German V-3, with a maximum range of 165 km. It was destroyed before it could be fired, although several experimental models were used in Luxembourg in 1944-1945. After the war, a U.S.-Canadian group revived the V-3, hoping to use it as a cheap weay to launch objects into space. According to this military history site:
Using a testing facility in the Barbados, the HARP team managed to fire a 400-pound non-explosive projectile out over the Atlantic at a speed of 8000 mph (that’s Mach 10). The missile also reached an altitude of 112 miles (nearly 600,000 feet) – a record for highest-flying artillery shot that still stands.
The Paris Gun, which was used in combat in 1918, only had a range of 130 km, but even then it couldn't hit a target smaller than a city, and (according to the same site):
. . . the gunners actually needed to calculate the earth’s rotation when aiming the weapon. Simply put, by the time one of the gun’s shells returned to earth from its then unprecedented 130,000 foot high flight path, the city had moved slightly with the planet’s own rotation.
In 2005 the Advanced Modular Gun Demonstrator test fired 85 miles or 137km and the shells could go 45km high. One article quotes the barrel pressure at 100,000 psi which is absurd. However, it is research equipment, not a practical weapon.
Here is a presentation about it that looks so bad I'd think it were a joke if I didn't know better.
That edges out the Paris Gun, which still holds the title of the longest shots fired in anger despite being nearly 100 years old. It fired a 106 kg shell to a range of 130 km and a maximum altitude of 42 km. It was purely a terror weapon, only having the accuracy to hit a city.
A railgun currently being developed by the US navy is planned to be integrated onto a ship by 2016 (although the reference is from 2010) with an estimated range of 160 km. It's unclear how far the current technology is able to reach given the probable secrecy of the project. The end goal is to eventually reach as far as 370 km.
See the article about Project Babylon at Wikipedia.org
In addition to the HAARP projects which are well mentioned above which achieved velocities of Mach 10 at an extraordinary altitude of 300,00 feet there is also speculations concerning a "Project Thor" which drops a tungsten rod straight down from outer space...and is perfectly legal actually.
The theoretical power of such a weapon is quite spectacular.