I'm trying to export data from one database into another database.
'do cursor
dim theCursor as VCursor = theDatabase.SqlSelect("select * from Attachment where recid = 0", EVCursorLocation.kServerSide, EVLockType.kNoLocks, EVCursorDirection.kRandom)
'set the fields
theCursor.SetBlank
theCursor.Field("MailID").SetString(Str(theRecID))
dim AttachmentName as string = EncodeAttachmentname(theAttachment.Name)
theCursor.Field("AttachmentName").SetString(AttachmentName)
'write the main attachment data
dim theBlob as VBLOB = VBLOB(theCursor.BlobField("AttachmentData"))
if theBlob <> Nil then theBlob.WriteData(theAttachment.getMimeData)
'and now add this to Valentina
if theCursor.AddRecord > 0 then
NumberOfAttachments = NumberOfAttachments + 1
else
Globals.theErrorLog.logitem "Cursor: " + str(theCursor.DataBase.ErrNumber) + " " + theCursor.DataBase.ErrString, ""
end if
The exception occurs for the line with AddRecord.
Valentina 8.7. Xojo 2018r3, High Sierra.
Mit freundlichen Grüßen/Regards
Beatrix Willius
http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals