NSFDbOpen call from LotusScript - A GOTCHA
Category API calls in LotusScript
Bookmark :
For those of you who write LotusScript aand make calls to the Notes API, here's a little tip about a call that you'll use all the time.
I was trying to work out why some code I use to retreive the Usage Stats of some database ALWAYS caused my client to produce an NSD. When I looked at the FilePath of the databases it was clear what the possible problem was. The databases had been created on servers mostly used by French speakers (no, that's not the specific problem
) and so, they contained Extended ASCII characters ( i.e. non-English
characters) such as é, è. That is, characters with an ASCII value
greater than 127.
The API declaration I had was
Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval dbName As String, hDb As Long) As Integer
which caused the NSD, but, when I changed the declartion to
Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval dbName As Lmbcs String, hDb As Long) As Integer
everything was OK.
Without making this subtle change and passing the FilePath of the database as a Double-Byte Character, the whole thing blows up, but, with the change, all is well.
Bookmark :
For those of you who write LotusScript aand make calls to the Notes API, here's a little tip about a call that you'll use all the time.
I was trying to work out why some code I use to retreive the Usage Stats of some database ALWAYS caused my client to produce an NSD. When I looked at the FilePath of the databases it was clear what the possible problem was. The databases had been created on servers mostly used by French speakers (no, that's not the specific problem
The API declaration I had was
Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval dbName As String, hDb As Long) As Integer
which caused the NSD, but, when I changed the declartion to
Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval dbName As Lmbcs String, hDb As Long) As Integer
everything was OK.
Without making this subtle change and passing the FilePath of the database as a Double-Byte Character, the whole thing blows up, but, with the change, all is well.


Category