By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,654 Members | 1,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,654 IT Pros & Developers. It's quick & easy.

Trap Error 2501

P: 2
Hi there,
Is there a way to avoid hard-coding the error number 2501 when trapping a no data error? Does Microsoft have a "code" for this error number ?
Thanks
Karla
Feb 13 '08 #1
Share this Question
Share on Google+
3 Replies


Scott Price
Expert 100+
P: 1,384
I'm not sure if I understand what you mean. 2501 IS the code for the 2501 error.

I assume you are writing a custom error handler routine? Can you paste in the code you are using?

Regards,
Scott
Feb 13 '08 #2

P: 2
I'm not sure if I understand what you mean. 2501 IS the code for the 2501 error.

I assume you are writing a custom error handler routine? Can you paste in the code you are using?

Regards,
Scott
Sorry - I was hoping for something like a variable (i.e. "vbNoData" or some representation) for the error - just in case Microsoft decides to change the value from 2501 to 2502 or 2503 or some other value in the future. I just do not like having "magic numbers" in my code. I've currently set up my own variable but just thought Microsoft has already defined the error codes somewhere.
Thanks,
Karla
Feb 15 '08 #3

Scott Price
Expert 100+
P: 1,384
I see, sorry to tell you that there's no guarantee that MS won't change the 2501 number at some point in the future with another programming language update.

However, I think that's going to be the least of your worries in the eventuality of such an occurrence.

Those numbers have been fairly well set (as far as I know) for quite a long time, so there really is no reason to change them. What IS changing with each new language update (i.e. VB6 to VB.NET) is that the method of handling errors gets more sophisticated and powerful. IF Access eventually supports the .NET framework (which A2007 might do, I've been avoiding it like the plague so far, so am not sure) you will need to re-write your error handling code anyway, assuming you upgrade to A2007, so the 'magic number' will be, as I said, the least of your worries.

Regards,
Scott
Feb 15 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.