Keq is the equilbrium constant
Ksp is the solubility constant
They are related in that Ksp is a type of Keq, but Ksp only deals with how soluble something is under specific conditions.
Keq is alot more general, and is usually used to designate what a reaction looks like at equilibrium (ie: max. entropy). The reaction type can be varied, ranging from a salt dissolving (Ksp), an Acid disassociating (Ka) etc..
The formula for any type of Keq is always [products]/[reactants]. There are specific rules though.. but in general, this equation works.