Forum Moderators: open
Now, I'm not too hot on ASP, and without knowing the code that triggers the error there's only so specific I can get. But if my assumption is correct it should be a fairly straightforward error routine: if records don't exist, then output a 404 header with Response.Status = "404 Not Found".
It might be possible to hack a custom error document to try to achieve a similar thing, but unless I've misunderstood what's going on that wouldn't be a very good approach.