Addition : Platform Win2k8 Server x64
Hello Community,
for six years we are using a odbc-connection to import data to notes-domino. This script worked fine everytime.
I added the script to this post.
now, by migrating the application from nd6-x86 to nd8-x64, the server sometimes crashes after starting the script.
The following happens:
a) if the source-file (ntish.dat) is EMPTY, the script adds the “ENDLINE”-Row to the odbc-file (import.txt) and runs as normal
b) if there is 1 or more data in the source-file, the script writes only the data to import.txt, but NOT the “Endline”. Afterwards the server hang up and the notes-agent-manager crashes (Process C:\Domino\namgr.EXE (3292/0xCDC) has terminated abnormally)
Any idea ???
(the script isn’t written by me, but by an external consultant)
Thanks for any help
Stephan Reintjes
Kleve, Germany
Option Public
Uselsx “NLSXODBC”
Sub Initialize
'Schnittstellenadministration
Const datenquelle = "import" 'Name of odbc-Connextion on Server
Const dateiname = "import.txt" 'textfile for imported data
Const impdat = "\\\\Nas-rk-bed\\Workarea_RK-BED\\_Intranet_DB\\KIS_Notes8\\ntish.dat" 'Name and path of source-data-file
Const odbcdat = "f:\\KBS_IMPORT\\import.txt" 'Name of ODBC-Sourcefile
Const anhang = "ntish.dat" 'Name der angehängten Datei
Const srvlog = "dom-zv30/srv/lvr" 'Servername Protokolldatabase
Const dblog = "notesapp\\kueche\\rkbed_protokoll.nsf" 'Protokolldatenbank
'------------------------------------------------------------------------------------------------------------------
Print "Import wird übertragen in Laufdaten"
Dim ns As New NotesSession
Dim db As NotesDatabase
Set db = ns.CurrentDatabase
Dim logdb As New NotesDatabase(srvlog,dblog)
Dim logdoc As NotesDocument
Dim logarray () As String
Dim logarray2 () As String
Dim logindex As Integer
logindex = 0
Redim logarray(0 To 0)
Redim logarray2(0 To 0)
Set logdoc = logdb.CreateDocument
logdoc.form="IMPORTSESSION"
logdoc.importdatum = Now
Dim prof As NotesDocument
Set prof = db.GetProfileDocument("MasterDatFile")
Dim doci As NotesDocument
Set doci = db.CreateDocument
doci.Form="FILE"
Dim rtitem As New NotesRichTextItem(doci,"Body")
Dim myfile As NotesEmbeddedObject
Set myfile = rtitem.EmbedObject(1454,"",impdat)
Call doci.Save(True,True)
Dim clearfile As NotesEmbeddedObject
Set clearfile = prof.GetAttachment(anhang)
Call clearfile.ExtractFile(impdat)
Call myfile.ExtractFile(odbcdat)
Sleep(10)
Dim doc As NotesDocument
Dim dat As NotesDateTime
Dim con As ODBCConnection
Dim qry As ODBCQuery
Dim result As ODBCResultSet
Set con = New ODBCConnection
con.ConnectTo(datenquelle)
Set qry = New ODBCQuery
Set qry.Connection = con
qry.SQL = "SELECT * FROM " & dateiname
Set result = New ODBCResultSet
Set result.Query = qry
Call result.execute
Call result.AddRow
Call result.SetValue("Start","ENDLINE")
Call result.UpdateRow
Call result.Close(DB_COMMIT)
Call con.Disconnect
con.ConnectTo(datenquelle)
Set qry = New ODBCQuery
Set qry.Connection = con
qry.SQL = "SELECT * FROM " & dateiname
Set result = New ODBCResultSet
Set result.Query = qry
Call result.execute
result.FirstRow
Do
Set doc = db.CreateDocument
doc.form="IMPORT"
doc.Import = result.GetValue(1)
Select Case Right$(Left$(doc.Import(0),35),6)
Case "NP11I0"
doc.ereignis = "AUFNAHME"
Case "NP91BI"
doc.ereignis = "ABWESEND"
Case "NP91EI"
doc.ereignis = "ZURUECK"
Case "NP97I0"
doc.ereignis = "ENTLASSEN"
Case "NV11I0"
doc.ereignis = "VERLEGT"
End Select
Set dat = New NotesDateTime(Right$(Left$(doc.Import(0),122),2) &"." &Right$(Left$(doc.Import(0),120),2) &"."& Right$(Left$(doc.Import(0),118),4)_
& " " & Right$(Left$(doc.Import(0),124),2) & ":" & Right$(Left$(doc.Import(0),126),2) & ":" & Right$(Left$(doc.Import(0),128),2))
doc.datum = dat.LSLocalTime
doc.PName = Right$(Left$(doc.Import(0),186),50)
doc.PFallNr = Right$(Left$(doc.Import(0),114),10)
doc.orgUnit = Right$(Left$(doc.Import(0),136),8)
Call doc.save(True,True)
Redim Preserve logarray(0 To logindex)
Redim Preserve logarray2(0 To logindex)
logarray(logindex) = doc.import(0)
logarray2(logindex) = doc.ereignis(0)
logindex = logindex + 1
Call result.NextRow
Loop Until result.IsEndOfData
logdoc.log = logarray
Call logdoc.save(True,True)
result.Close(DB_CLOSE)
con.Disconnect
Print "Import ist beendet"
End Sub