I have a simple @dbcolumn formula used in a dialog list field on the web the returns the error: “incorrect datatype for database function”
My formula is: @DbColumn(“”:“”;“”:“kenlevi\Productinfo.nsf”; “Itemnumberlist”;“1”)
I really appreciate any help as I have looked everywhere!
thank you
Ken
Subject: Simple @dbcolumn will not work!
I see a couple of things here:
@DbColumn(“”:“”;“”:“kenlevi\Productinfo.nsf”; “Itemnumberlist”;“1”)
you should only need one backslash for the path and the column number should be a number - not literal text
should be:
@DbColumn(“”:“”;“”:“kenlevi\Productinfo.nsf”; “Itemnumberlist”; 1)
Subject: RE: Simple @dbcolumn will not work!
J Aubry is incorrect, you do need double backslashes.It’s true, however, that the column number should be a number, not a quoted string.
Subject: RE: Simple @dbcolumn will not work!
I stand corrected.
I forgot that in this case, the directory requires one backslash with the second one escaping it due to it being inside the quotations.
From the designer help:
If your database is located in a DOS or OS/2 subdirectory, such as MAIL\MINE.NSf, put a double backslash between the directory and the database name, as in “MAIL\MINE.NSF”, because formulas treat backslashes as “quote” characters.
Please forgive passing the incorrect information to the forum.
Subject: RE: Simple @dbcolumn will not work!
OMG! How could I miss that! I spent a LONG time in the wrong places. Ugh.
Thank you very much,
Subject: RE: Simple @dbcolumn will not work!
I have one more suggestion. Providing server and database in the format
“”:“MyPath\MyDatabase.nsf”
can sometimes yield unexpected results. In this case, the “” always stands for “local”, not for the “current” server (whereas “”:“” or simply “” always stands for the current database on the current server). If that same code is ever executed on the server and on the workstation, it will try to access the db once on the server and once on the workstation.
Depending on your needs, specifying
@DbName[1] : “MyPath\MyDatabase.nsf”
might me more robust.