1. Beatrix Willius
  2. Valentina Database ADK
  3. Wednesday, March 06 2019, 09:45 AM
  4.  Subscribe via email
What does the above VException mean?

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
Comment
There are no comments made yet.
Beatrix Willius Accepted Answer
Got it. Had the old RecID of the table plugged in instead of the new one.
Comment
There are no comments made yet.
Beatrix Willius Accepted Answer
Ah yes, got an idea what I might have done wrong.
Comment
There are no comments made yet.
Beatrix Willius Accepted Answer
Sorry. Forgot the number: 529697.
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
The only possible reason is - Not valid theRecID
Comment
There are no comments made yet.
Beatrix Willius Accepted Answer
MailID is the foreign key.

Link_2 describes this:


-- CREATE LINK "Link_2" ----------------------------------------
ALTER TABLE "Attachment"
MODIFY "MailID"
OBJECTPTR CONSTRAINT "Link_2"
REFERENCES "Message"
ON DELETE Cascade
INDEXED;
-- -------------------------------------------------------------
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories