Hi,
I'm back with yet another problem. I think the solution is quite simple, but I fail to see it, so maybe you can help me out.
For a certain program, I use a translation-table (Access, with ODBC/ADO connection... works fine).
The layout of the table:
<key> | <langF> | <langN> | <langE> | <langD>
Now when I load my program, I check a config-file and load all the labels in the language selected by the user. In order to do this, I have written a function called 'Translate' which requires two strings as parameters. First one is the 'key', the next is the language-code. This also worked fine but then I decided to add an extra safety-check: if there is no translation defined for the 'key', the function would return the 'key' instead of just halt everything.
In order to do this, I changed this line:
Translate = adoRecordset(strLanguageField) & ""
into this one:
Translate = IIf(adoRecordset(strLanguageField) & "" = "", strKey, adoRecordset(strLanguageField))
Since I though that IIf would only look at the part it needed, this would work like a charm.
Big surprise, it didn't.
Now... is there a way to get this done without having to resort to error-trapping and such?
(so basically what I want is ... when a null-value is returned from the DB, the function would return a custom value...)
I'm back with yet another problem. I think the solution is quite simple, but I fail to see it, so maybe you can help me out.
For a certain program, I use a translation-table (Access, with ODBC/ADO connection... works fine).
The layout of the table:
<key> | <langF> | <langN> | <langE> | <langD>
Now when I load my program, I check a config-file and load all the labels in the language selected by the user. In order to do this, I have written a function called 'Translate' which requires two strings as parameters. First one is the 'key', the next is the language-code. This also worked fine but then I decided to add an extra safety-check: if there is no translation defined for the 'key', the function would return the 'key' instead of just halt everything.
In order to do this, I changed this line:
Translate = adoRecordset(strLanguageField) & ""
into this one:
Translate = IIf(adoRecordset(strLanguageField) & "" = "", strKey, adoRecordset(strLanguageField))
Since I though that IIf would only look at the part it needed, this would work like a charm.
Big surprise, it didn't.
Now... is there a way to get this done without having to resort to error-trapping and such?
(so basically what I want is ... when a null-value is returned from the DB, the function would return a custom value...)