I'm a little confused by the setup that you currently have. It looks like you are hard coding the quantity to 1 in your add to cart server behavior. You should instead have a quantity text field in your add to cart form that allows the user to enter the stock they would like.
Then you would compare this posted value to the stock in the db with the check that you are doing. Currently you are setting the value of the form element for the stock amount to the value from your recordset, then you are checking these values in the validation. Since they are always the same the validation will never fail. The check is ok, you just need to allow the user to enter their own amount so that it will trigger the validation if they enter an amount that is greater than what you have.