Page 1 of 1

Controlling messages

PostPosted: Wed Jun 04, 2008 4:58 pm
by carlos torres
Hi everybody

I'm using DbPro and trying to produce some errors like duplicate record key and so on... The error messages is to long.

How can I re-design/rewrite those error messages?

TIA

regards
carlost

PostPosted: Thu Jun 05, 2008 9:59 am
by Neosoft Support
The majority of the error messages are generated by the database engine (Access, mySQL, etc.) or driver not DBpro, which simply passes the message along to NeoBook. Unfortunately, as far as I know there is no comprehensive list of error messages available, which makes translation extremely difficult. What I would suggest is that you translate only the most common error messages and ignore the ones that occur only rarely. For example:

First, turn off error messages:

Code: Select all
dbfShowErrors "False"


Then after important dbp commands do something like this:

Code: Select all
dbp...
If "[dbpError]" "=" "duplicate record key"
  .translate
  AlertBox "Error" "Llave de registro duplicado."
Else
  If "[dbpError]" ">" ""
    .display as is
    AlertBox "Error" "[dbpError]"
  EndIf
EndIf

PostPosted: Fri Jun 06, 2008 7:55 am
by Wrangler
Here is a list of Access error messages. May help a little:

http://download-west.oracle.com/docs/cd ... 7262/a.htm

PostPosted: Fri Jun 06, 2008 9:36 am
by Neosoft Support
Wow! That's a long list. Thanks for posting the link.

PostPosted: Fri Jun 06, 2008 9:54 am
by Gaev
Wow! That's a long list. Thanks for posting the link.

Wonder if NeoBookDBPro is returned the error numbers associated with each error description ... might be a good idea to build a "Database Table of Access Errors" ... and a generic routine that "returns the description for a given error number" ... then developers can include the appropriate "language" Table in their applications ... I am pretty sure MicroSoft has a similar list for the other major languages ... so may not need to do a manual (or google/yahoo) translation.

Spoiler !!! ... a number of error descriptions are not static e.g. ...

3006 Database <name> is exclusively locked

... where <name> represents a placeholder for a value that is given when the error message is displayed ... so the translator is not going to be a simple piece of code.

About Error Messages

PostPosted: Fri Jun 06, 2008 3:21 pm
by carlos torres
Thanks NB Support for your suggestion
Thanks Wrangler for the link

I agree with you about using the common errors.

regards

carlost