Tried every thing,posted 3 times but nothing is working

Hello all,

I am very depressed as I try doing the following in hundreds of ways

I need to get each person’s ID from names.nsf database and put it in another database

so I created a view inside the names.nsf sorted by employee id and ran the follwing agent

Set db = NSession.currentdatabase

Set namedb=NSession.GetDatabase(“”,“names.nsf”)

Set employeeview=db.GetView(“EmpNo”)

Set addempbynoview=namedb.GetView(“Peoplebyid”)

Dim id As String

id=“009097”

Set doc=employeeview.GetDocumentByKey(id)

Set adddoc=addempbynoview.GetDocumentByKey(id)

doc.Employee=adddoc.FullName(0)

Call doc.Save(True,False)

while debugging I found that the agent cannot get the view Peoplebyid from names.nsf database

so I got nothing but object variable not set error

is there any way to search in the address book by id

I got nothing unique to count on but each person’s id ,names can be similar so I cannot count on names,I restarted the server and I made sure that the names.nsf contains my view,does this have any thing to do with database type as it is domino directory not a standard database

any help will be great

best regards

Dalia

thanks

Dalia

Subject: tried every thing,posted 3 times but nothing is working

Try the following at the beginning of the code; this should work regardless of which replica you’re working in:

dim s as New NotesSession

dim db as NotesDatabases

set db = s.CurrentDatabase

Set db = NSession.currentdatabase

Set namedb=NSession.GetDatabase(“”,“names.nsf”)

. . . .

Also, I assume you’re dim’ing those other variables (employeeview, addempbynoview) someplace else.

If you run this on the local replica on your workstation, ‘names.nsf’ is our personal address book. Notes won’t let you overwrite that while the client is open.

Subject: tried every thing,posted 3 times but nothing is working

Hi,Did u add this view to ur server names.nsf or local? because it seems that ur script is opening the local names…

Hope this helps.

Subject: RE: tried every thing,posted 3 times but nothing is working

Hi Sam,the view is added in both local and server replicas

thanks

Dalia

Subject: RE: tried every thing,posted 3 times but nothing is working

Are you sure? Normally, the local database called “names.nsf” is YOUR PERSONAL address book (the one based on pernames.ntf).