| « Sore loser: Connie Sonne (JREF Challenge at TAM7) | Odd: Swearing can reduce the feeling of pain » |
Removing a full text index on a server
I've whipped up this little code after searching the web on how to use the C-api.
It's actually easier then I thought, but I'm sharing it anyway.
Download the code here: removefti.lss
It's actually easier then I thought, but I'm sharing it anyway.
ls2html was brought to you by nsftools.com'Remove FTI: Declare Function FTDeleteIndex Lib "nnotes.dll" (Byval hDB As Long) As Integer Declare Function NSFDbClose Lib "nnotes.dll" (Byval hDB As Long) As Integer Declare Function NSFDbOpen Lib "nnotes.dll" (Byval filepath As String, DB As Long) As Integer Declare Function OSPathNetConstruct Lib "NNOTES" Alias "OSPathNetConstruct" _ ( Byval NullPort As Long, Byval Server As String, Byval FIle As String, _ Byval PathNet As String) As Integer Sub Initialize Dim Bufferstr As String Dim ReturnCodel As Long Dim hDB As Long Dim errorstr As String Dim pathName As String pathName = String(256, " ") Call OSPathNetConstruct(0, SERVER, PATH, pathName) Dim result As Integer 'open the dataase result = NSFDbOpen(pathName, hDb) If Result <> 0 Then errorstr="An error occurred in the main routine calling the API function NSFDbOpen." & Chr$(10) & "The return code was " & Trim$(Str$(ReturnCodel)) & "." Exit Sub End If 'Delete the index ReturnCodel = FTDeleteIndex(hDB) If ReturnCodel <> 0 Then errorstr="An error occurred in the main routine calling the API function FTDeleteIndex." & Chr$(10) & "The return code was " & Trim$(Str$(ReturnCodel)) & "." Call NSFDbClose(hDB) Exit Sub End If 'Close the database ReturnCodel = NSFDbClose(hDB) End Sub
Download the code here: removefti.lss