Hi,
We are exporting data from notes to local drive using
Set expData = session.CreateDXLExporter
but when export function called
strOutput = expData.Export(subDoc)
its raising error: Error accessing product object method.
This problems is only with one user in his local machine german region and this application is multilingual.
I am successfully able to archive the data in my local.
Here is the code:
Sub ExportData()
'This routine archives all the Sales Data belonging to the particular year
On Error Goto exportData_handler
Dim dc As NotesDocumentCollection
Dim strSql As String
Dim session As NotesSession
Set session = New NotesSession
'Select condition to identify the documents to be archived
strSql = "((Form = ""fr_PlanForecast"" | Form = ""fr_Sales"" | Form = ""fr_Count"" ) & fl_Year =""" & mYear & """)"
Set dc = db_data.Search(strSql,Nothing,0)
If dc.Count <= 0 Then
Exit Sub
End If
Dim expData As NotesDXLExporter
Dim strOutput As String
Print "Writing Data.dxl..."
Dim LoopCnt As Long
Dim subDoc As NotesDocument
Dim OutCnt As Long
Set expData = session.CreateDXLExporter
OutCnt = 1
fileName$ = "C:\PlatinumBackUp\" & mYear & "\Data"+Cstr(OutCnt)+".dxl"
Open fileName$ For Output As fileNum% Charset="UTF-8"
Set subDoc = dc.GetFirstDocument
For LoopCnt = 1 To dc.Count
strOutput = expData.Export(subDoc)
Print #filenum%, strOutput
If LoopCnt Mod 100 = 0 Then
OutCnt = OutCnt +1
Close filenum%
fileName$ = "C:\PlatinumBackUp\" & mYear & "\Data"+Cstr(OutCnt)+".dxl"
Open fileName$ For Output As fileNum% Charset="UTF-8"
End If
Set subDoc = dc.GetNextDocument(subDoc)
Next
ArchiveMsg = ArchiveMsg & "Data " & Chr(9) & Chr(9) & Chr(9) & Cstr(dc.Count) & " " & Chr(13)
'Call dc.RemoveAll(True)
Exit Sub
exportData_handler:
ArchiveMsg = ArchiveMsg & "Data " & Chr(9) & Chr(9) & Chr(9) & Chr(45) & " " & Chr(13)
Call displayError("Data.nsf", "ExportData")
Exit Sub
End Sub
Subject: RE: Error accesing product object method
Trap the error using On Error and display the Log property of the Exporter for a better explanation of the problem.
Subject: RE: Error accesing product object method
Thanks Andre,
We are already trapping the error and same error shows when the error occurred.
This problem occures with only one user and he is in Germany.
He is using local replica. we are not able to reproduce the error.
Any other thoughts will be appreciated.
Regards,
Sazid.
Subject: RE: Error accesing product object method
I see in your code you are trapping the error, but I do not see you displaying or logging the line number (to make sure you really know where the error is) or the value of expData.Log. You might also display information about the document it’s trying to export at that time, e.g. its UNID or the value of a key field, so that you can find it in a different replica and see whether there’s anything unusual about it.
Any chance this user is using a different Notes version from the rest of you? The Export method was added in 6.5. Does he export some documents successfully? Or does it fail on the first one?
DXL is not perfect - especially in version 6.5.5. It’s possible there’s one document in there that just won’t export. In that case, you may have to skip it and go on to the next document, and log the information so that you know there’s a document you need to fix. Such errors might most commonly occur with odd rich text. If that is the case here, you may be able to fix it by compacting the rich text in the problem document, or by just manually editing and resaving the document after making some trivial change in the rich text (add and delete a space, say).
BTW it’s inefficient to export to a string and then write the string to a file. Use NotesStream and you can do the DXL output generation and file storage in a single step.
Subject: RE: Error accesing product object method
Thank you very much for your detailed response.
its hard to trap the error as you specified in users machine as it has to go many channels like
WIP recompilation 7 hours->UAT->CUR->Convert into regional German language using DGW->LIVE->Local replica to User machine.
but we are atleast trapping the line number that is in common function displayerror and in scriptlibrary used by this agent.
we are also suspecting the version problem, user has to come back.
If any code change as you told not to use string for exporting, I have tested the notesstream and its working on my local for around 40K documents. but I doubt if records more than 3 lacs to archive as it is in German live, in that case any problems with dxl file.
Error is raised at very first document for that user only.
No other user has reported this problem.
any other thoughts please…
thaks for your response.