How I can use if (db.remove(True)) Then

HiI am getting error message at If (call namesdb.Remove) Then

If namesdb.isOpen Then

If (call namesdb.Remove) Then

Goto ThisIF

Else

Set namesdb = Nothing

Kill FulldirnoteFinal & "names.nsf"

End If

Else

Call AppendAgentLogMessage(gagentlogdoc,"Error",FulldirnoteFinal & "names.nsf" + " not open")

End If

ThisIf:

Thanks

Subject: You can not remove names.nsf anyway. That is 1 database that is always in use Client or Server.

Subject: RE: You can not remove names.nsf anyway. That is 1 database that is always in use Client or Server.

Hi Bill Yesterday I had other post related to this problem.

Here is background of issue.

Hi

For Citrix environment, I have database where I have attach a template of personal address book. I select a user in my database and detach the pnab in a local drive and create the location and connection doucment as well as update the user mail file and mail server info in address book. Then attach the pnab to user document then other agent detach the pnab to the user citrix folder. But after updating the address book and attach it to document and try to delete the pnab in local folder getting error

Error 4005:File is in use by another programe.

following is part of script.

Here I am updating the pnab…

Dim namesdb As New NotesDatabase(“”,“”)

Call namesdb.Open(“”,FulldirnoteFinal & “names.nsf”)

If namesdb.isOpen Then

Dim namesdoc As NotesDocument

Dim namesview As NotesView

namesdb.Title=“Personal Address Book”

Set namesview = namesdb.GetView(“Adva_nced\Locations”)

Set namesdoc = namesview.GetFirstDocument

namesdoc.ImailAddress = doc.CnabInternetAddress(0)

namesdoc.MailServer = doc.CnabMailServer(0)

namesdoc.MailFile = doc.CnabMailFile(0)

Call namesdoc.save(True, False)

Set namesdoc=Nothing 'addeded 421

End If

Here deleting the pnab from local drive.

If namesdb.isOpen Then

Call namesdb.Remove

Else

Call AppendAgentLogMessage(gagentlogdoc,“Error”,FulldirnoteFinal & “names.nsf” + " can not delete")

End If

Any idea why I am getting the error.

Subject: How I can use if (db.remove(True)) Then …

what’s the error message?

Subject: RE: How I can use if (db.remove(True)) Then …

call: Expected expression

Subject: RE: How I can use if (db.remove(True)) Then …

I made the following changes but in call line still getting error …Dim result As Integer

	If namesdb.isOpen Then

		result%=call namesdb.Remove(true)

		If result% Then

			Msgbox result%

			Goto ThisIF

		Else

			Set namesdb = Nothing

			Kill FulldirnoteFinal & "names.nsf"

		End If

	Else

		Call AppendAgentLogMessage(gagentlogdoc,"Error",FulldirnoteFinal & "names.nsf" + " not open")

	End If

ThisIf:

Subject: RE: How I can use if (db.remove(True)) Then …

I think that part of the problem is that db.remove does not return true or false - it just tries and succeeds or fails. I think you may need to manually check if the db still exists

could be wrong tho