Antrid 2.10 and error locating lotus notes

Hello everyoneI am using Antrid 2.10 , but when I execute it I get an error - Error locating Lotus Notes installation on this machine. In my machine notes client is 7.0

I don’t want to use Antrid 7.0 as company policy and company not going to pay.

Any ideas?

Thanks

Lisa

Subject: Antrid 2.10 and error locating lotus notes

Why do you use Antrid if you don’t want to use it and your company policy forbids it?

There are several free tools out there which do the same without errors, changing a database Replica ID. As a developer I use CNotes (http://siipi.com/cnotes), since I don’t like manual actions.

Subject: RE: Antrid 2.10 and error locating lotus notes

Hi Mike Uisng the image we insall lot of user and most of them got same replica id of names.nsf and now when they are using the black burry they are getting error about same replica. I want to a tool to change the replica id of names.nsf.

Could you please let me know if there is any script. Thanks

Lisa

Subject: RE: Antrid 2.10 and error locating lotus notes

Yes there is a script for changing ReplicaID of a database, it was also under the link I mentioned, but here it is again for your convenience:

See Example # 2: Change Database Replica ID:

http://www.openntf.org/Projects/codebin/codebin.nsf/CodeByDate/B73546A8241899FF8625714B004E9411

You should be able to fully automate the changing of ReplicaID’s of the users names.nsf. Just create a random or progressive database ID string (All ID’s in Notes are based on a time/date anyway).

Subject: RE: Antrid 2.10 and error locating lotus notes

Hi Mike I downloaded the cnotes and in script library, there is only one library cnotes and I can see only

%INCLUDE “CAPI.LSS” there. Is there any other library or I am missing some thing here.

Thanks

Lisa

Subject: RE: Antrid 2.10 and error locating lotus notes

That is enough, as the Script Library is already compiled. You don’t need the CAPI.LSS. You just copy the script library to your own database.

Subject: RE: Antrid 2.10 and error locating lotus notes

Thanks for help Mika, Mika, how I can generate the replica id for each user names.nsf ??

Thanks

Lida

Subject: RE: Antrid 2.10 and error locating lotus notes

Since the universal ID is a time based constant, you could do it like this (from Notes’ perspective it’s the same if you just created a new document or a new database, this way you get a Notes-like universalid):

Sub Initialize

Dim session As New notessession

Set db=session.currentdatabase

Set doc=db.createdocument

unid = doc.universalid

End Sub

Although you could also use a totally random 32 digit hex number, I think this is still a cleaner solution (and less code!).

Subject: RE: Antrid 2.10 and error locating lotus notes

Thanks again Mika for your kind help.Using you cNotes library, I am able to change the replica id of each user personal address book.

It’s so easy to use.

Thanks

Lisa

Subject: Question for Mika

HiI created a agent which use cnotes library to change the replica id of user address book, now it working fine, but other user will have to run the agent, then should I have to send them cnotes library script db to them, or cnotes library will compile itself from there workstation.

Please let me know.

Thanks

Lisa

Subject: RE: Question for Mika

You can make a new database on your server which has your agent and the CNotes script library. Then you don’t need to send any files to the users, just a database link. Since the agent is now in a different database than the user’s mail database, you need to get the user’s mail database with the following LotusScript command:

maildbname = Evaluate(“@MailDbName”)

now maildbname(0) contains the server name,

and maildbname(1) contains the filename of mail box

Subject: Question for Mika, one more…

Sorry to ask you too much.

I have one more question…

I am using the other script library which create the replica id and store in a field, then using your cnotes library I update the selected user address book replica id ( user are in Citrix environment, so I can map the drive and run the script).

If I am creatig two separte agent it working fine, but when I tried to combine both the agent and create one script to

  1. create replica id and put it in field

  2. using cnotes get the value from that field and update the user names.nsf replica id.

but now I am getting the following error…

DUPLICATE PUBLIC name TIMEDATE in use

Following is other script library and code

[Agent: Generate Unique Rep ID] – stamps a field called NewRepID with a “unique” rep id.

Option Declare

Use “C-API Declarations”

Sub Click(Source As Button)

On Error Goto ErrHandler

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

Dim dtNow As New NotesDateTime(Now())

Dim memman As New memoryManagerExt

Dim p As Long

Dim p0 As Long

Dim hdb As Long

Dim replInfo As DBREPLICAINFO

Dim s As New NotesSession

Dim db As NotesDatabase

Dim rc As Integer

Dim buffID As String*256

Dim intDate1 As Integer

p = memman.newBuffer(256)

p0 = p

Set db = s.CurrentDatabase

If p > 0 Then

hdb = openDb(db)

rc = W32_NSFDbReplicaInfoGet(hdb, replInfo)

Call W32_ODSWriteMemoryByVal(p, ODS_BYTE, dtNow.LSLocalTime & Chr(0), 256)

Call W32_ConvertTextToTIMEDATE(0, 0, p0, 256, replInfo.ID)

Call W32_ConvertTIMEDATEToText(0, 0, replInfo.ID, buffID, 256, intDate1)

Print "Setting new timestamp to: " & buffID & Chr$(0)

Dim t1 As Variant, t2 As Variant

Dim L1 As Integer, L2 As Integer

t1 = Hex(replinfo.id.innards(1))

t2 = Hex(replinfo.id.innards(0))

L1 = Len(t1)

L2 = Len(t2)

If ((L1 > 8) Or (L2 > 8)) Then

Msgbox “weirdness, unable to complete operation”

Exit Sub

End If

If (L1<8) Then

t1 = PadRepPart(Cstr(t1))

End If

If (L2<8) Then

t2 = PadRepPart(Cstr(t2))

End If

Print "New RepID: " & t1 & “:” t2

Call uidoc.FieldSetText(“NewRepID”, t1 & t2)

End If

Call uidoc.refresh

Delete memman

continueOK:

If hdb <> 0 Then

rc = W32_NSFDbClose(hdb&)

End If

Exit Sub

ErrHandler:

Msgbox Err() & " : " & Error$()

Resume continueOK

End Sub

Function PadRepPart(b As String) As String

Dim i As Integer, bLen As Integer

Dim pad As String

Dim retStr As String

bLen = Len(b)

i=0

retStr = b

If (bLen < 8) Then

pad = “”

While (i+bLen) < 8

i = i +1

pad = pad & “0”

Wend

retStr = pad & retStr

End If

PadRepPart = retStr

End Function

…

[C API Declaration - script library]

Option Public

Option Declare

Public Const NO_ERROR% = 0

Public Const OS_TRANSLATE_LMBCS_TO_UNICODE% = 20

Public Const OS_TRANSLATE_UNICODE_TO_LMBCS% = 23

Public Const wAPIModule$ = “NNOTES” ’ Windows/32

’ ++ CORE API CALLS ++

Declare Public Function W32_NSFDbOpen Lib wAPIModule Alias “NSFDbOpen” _

( Byval P As String, hDB As Long) As Integer

Declare Public Function W32_NSFDbClose Lib wAPIModule Alias “NSFDbClose” _

(Byval hDB As Long) As Integer

Declare Public Function W32_NSFDbIsLocallyEncrypted Lib wAPIModule Alias “NSFDbIsLocallyEncrypted” _

( Byval hDB As Long, _

pBool As Integer) As Integer

Declare Public Function W32_OSPathNetConstruct Lib wAPIModule Alias “OSPathNetConstruct” _

( Byval NullPort As Long, _

Byval Server As String, _

Byval FIle As String, _

Byval PathNet As String) As Integer

Declare Public Function W32_NSGetServerList Lib wAPIModule Alias “NSGetServerList” _

(Byval pPortName As Lmbcs String, _

retServerList As Long) As Integer

Declare Public Function W32_NSGetServerListAll Lib wAPIModule Alias “NSGetServerList” _

(Byval pPortNameNULL As Long, _

retServerList As Long) As Integer

Declare Public Function W32_NSPingServer Lib wAPIModule Alias “NSPingServer” _

(Byval ServerName As Lmbcs String, _

loadIndex As Long, _

hList As Long) As Integer

Declare Public Function W32_ListGetText Lib wAPIModule Alias “ListGetText” _

(Byval pList As Long, _

Byval fPrefixDataType As Integer, _

Byval EntryNumber As Integer, _

retTextPtr As Long, _

retTextLength As Integer) As Integer

Declare Public Function W32_ListGetNumEntries Lib wAPIModule Alias “ListGetNumEntries” _

(Byval pList As Long, _

Byval typeRepresent As Integer) As Integer

Declare Public Function W32_OSLockObject Lib wAPIModule Alias “OSLockObject” _

(Byval handle As Long) As Long

Declare Public Sub W32_OSUnlockObject Lib wAPIModule Alias “OSUnlockObject” _

(Byval handle As Long)

Declare Public Sub W32_OSMemFree Lib wAPIModule Alias “OSMemFree” _

(Byval handle As Long)

Declare Public Function W32_OSTranslateToStr Lib wAPIModule Alias “OSTranslate” _

(Byval TranslateMode As Integer, _

Byval pInString As Long, _

Byval InLength As Integer, _

Byval OutString As Unicode String, _

Byval OutLength As Integer) As Integer

Declare Public Sub W32_OSLoadString Lib wAPIModule Alias “OSLoadString” _

(Byval null1 As Long, _

Byval ErrorCode As Integer, _

Byval ErrorString As String, _

Byval ErrorStringLength As Integer)

Const ODS_BYTE = 3

Public Type TIMEDATE

innards(1) As Long

End Type

Public Type DBREPLICAINFO

ID As TIMEDATE

Flags As Integer

CutoffInterval As Integer

Cutoff As TIMEDATE

End Type

Declare Function W32_NSFDbReplicaInfoGet Lib wAPIModule Alias “NSFDbReplicaInfoGet” _

(Byval hdb As Long, _

replInfoStruct As DBREPLICAINFO) As Integer

Declare Function W32_NSFDbReplicaInfoSet Lib wAPIModule Alias “NSFDbReplicaInfoSet” _

(Byval hdb As Long, _

replInfoStruct As DBREPLICAINFO) As Integer

Declare Function W32_ConvertTIMEDATEToText Lib wAPIModule Alias “ConvertTIMEDATEToText” _

(Byval nullFormat As Long, _

Byval textFormat As Long, _

td As Any, _

Byval Buff As String, _

Byval maxlen As Integer, _

textLength As Integer) As Integer

Declare Function W32_ConvertTextToTIMEDATE Lib wAPIModule Alias “ConvertTextToTIMEDATE” _

(Byval nullFormat As Long, _

Byval textFormat As Long, _

ptrTextBuff As Long, _

Byval maxlen As Integer, _

td As TIMEDATE) As Integer

Declare Function W32_OSMemAlloc Lib wAPIModule Alias “OSMemAlloc”(Byval flags As Integer, Byval length As Integer, handle As Long) As Integer

Declare Sub W32_OSMemoryFree Lib wAPIModule Alias “OSMemoryFree”(Byval h As Long)

Declare Function W32_OSMemoryUnlock Lib wAPIModule Alias “OSMemoryUnlock”(Byval h As Long) As Integer

Declare Function W32_OSMemoryLock Lib wAPIModule Alias “OSMemoryLock”(Byval h As Long) As Long

Declare Function W32_OSMemoryAllocate Lib wAPIModule Alias “OSMemoryAllocate”(Byval t As Long, Byval size As Long, handle As Long) As Integer

Declare Sub W32_ODSWriteMemoryStr Lib wAPIModule Alias “ODSWriteMemory” (pDest As Long, Byval typeODS As Integer, Byval pSource As String, Byval Iterations As Integer)

Declare Sub W32_ODSWriteMemoryByVal Lib wAPIModule Alias “ODSWriteMemory” (pDest As Long, Byval typeODS As Integer, Byval ppSource As Any, Byval Iterations As Integer)

’ ++ FANCY THICK CLIENT / UI CALLS

Public Const wAPIModuleWS$ = “NNOTESWS.DLL”

Public Const NPB_TWOLINE% = 1

Public Const START_PB% = 1

Public Const UPDATE_PB% = 2

Public Const STOP_PB% = 3

'-- Procedures in nnotesws.dll

Declare Public Function W32_NEMProgressBegin Lib wAPIModuleWS Alias “NEMProgressBegin” _

(Byval wFlags As Integer) As Long

Declare Public Sub W32_NEMProgressEnd Lib wAPIModuleWS Alias “NEMProgressEnd” _

(Byval hwnd As Long)

Declare Public Sub W32_NEMProgressSetBarPos Lib wAPIModuleWS Alias “NEMProgressSetBarPos” _

(Byval hwnd As Long, _

Byval dwPos As Long)

Declare Public Sub W32_NEMProgressSetBarRange Lib wAPIModuleWS Alias “NEMProgressSetBarRange” _

(Byval hwnd As Long, _

Byval dwMax As Long)

Declare Public Sub W32_NEMProgressSetText Lib wAPIModuleWS Alias “NEMProgressSetText” _

(Byval hwnd As Long, _

Byval pcszLine1 As String,_

Byval pcszLine2 As String)

Public Class memoryManager

Public OpenHandles List As Variant

Public Function LockObject(h) As Long

If h=0 Then Exit Function

LockObject = W32_OSLockObject(h)

OpenHandles(h) = LockObject

End Function

Public Sub UnlockObject(h)

If h =0 Then Exit Sub

If Iselement(OpenHandles(h)) Then

W32_OSUnlockObject h

Erase OpenHandles(h)

End If

End Sub

Public Function UnlockAll

Forall hh In Me.openHandles

Call Me.unlockObject(hh)

End Forall

End Function

Sub Delete

Me.unlockAll

End Sub

End Class

Public Class memoryManagerExt As memoryManager

Public buffers List As Long

Public Function newBuffer(lenBuffer As Long) As Long

Dim irc As Integer

Dim hBuff As Long

irc = W32_OSMemoryAllocate(0, lenBuffer, hBuff)

If irc=0 Then

If hBuff=0 Then Exit Function

buffers(hBuff) = W32_OSMemoryLock(hBuff)

newBuffer = buffers(hBuff)

Else

printCAPIError(irc)

End If

End Function

Sub Delete

Forall p In Me.buffers

W32_OSMemoryUnlock Listtag(p)

W32_OSMemoryFree Listtag(p)

End Forall

End Sub

End Class

Public Function getCAPIError(ErrorNum As Integer) As String

Dim retError As String * 256

Call W32_OSLoadString(0, ErrorNum And &h03ffffff, retError, 256)

getCAPIError = Strleft(retError, Chr(0))

End Function

Public Sub printCAPIError(ErrorNum As Integer)

Dim errorString As String

errorString = getCAPIError(ErrorNum)

Print "C API Error: " & errorString

End Sub

Function openDb(ndb As NotesDatabase) As Long

Dim retPath As String*1024

Dim irc As Integer

Dim h As Long

W32_OSPathNetConstruct 0&, ndb.Server, ndb.FilePath, retPath

irc = W32_NSFDbOpen(retPath, h)

If (irc <> 0) Then

Call printCAPIError(irc)

End If

openDB = h

End Function

…

Why I am getting the error??

Thanks again

Lisa

Subject: RE: Question for Mika, one more…

The error message is very clear, it tells you that something, in this case it’s my CNotes has already declared a Type called TIMEDATE.

You can remove:

Public Type TIMEDATE

innards(1) As Long

End Type

from your other code. The definition I use in CNotes is identical.

After that you will get the same error, and you can remove:

Type DBREPLICAINFO

ID As TIMEDATE 

Flags As Integer 

CutoffInterval As Integer 

Cutoff As TIMEDATE 

End Type

also.

Subject: Mika, One more again, I am getting error in Production…

Hi mikaIn ist environment, I tested the Cnotes to change the replica of user PNAB, now I copy the same agent in the production database, and now when agents comes to this line

cdb.Open “”, filepathfinal &“names.nsf”

cdb.SetReplicaID (replicaidStr)

I get the

Lotus notes Error Notification

An error has occured in notes application

Data about the error is being collected and send to helpdes…

Any idea please

Lida

Subject: Mika, I got the answer…

Actually when I was testing the agent to update the user PNAB replica id, That particular user was log in and I am getting the error. So If user in using the database then get the error.

Thanks for all the help Mika.

Lisa

Subject: RE: Mika, I got the answer…

Thank you Lisa for that information. I think that is another bug in Notes and I should report it to the IBM quality department.

Changing replica ID’s of databases (with no 3rd party tools, but just by making a new copy of the database for example) causes also known wierdiness in Notes, for example if you stack replica icons on your workspace, and the replica ID of a database changes, then Notes goes nuts, and you need to remove all the associated old replica icons from your workspace.

Subject: Antrid 2.10 and error locating lotus notes

I found that if you are not signed in as Full Administrator you get this error.

Subject: RE: Antrid 2.10 and error locating lotus notes

Hi SandraWhat do you mean by sign as full administrator??

Could you explain.

Thanks

Lisa