1. Beatrix Willius
  2. Valentina Database ADK
  3. Среда, Март 06 2019, 09:45 AM
  4.  Подписаться через 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
Комментарий
There are no comments made yet.
Beatrix Willius Ответ принят
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;
-- -------------------------------------------------------------
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
The only possible reason is - Not valid theRecID
Комментарий
There are no comments made yet.
Beatrix Willius Ответ принят
Sorry. Forgot the number: 529697.
Комментарий
There are no comments made yet.
Beatrix Willius Ответ принят
Ah yes, got an idea what I might have done wrong.
Комментарий
There are no comments made yet.
Beatrix Willius Ответ принят
Got it. Had the old RecID of the table plugged in instead of the new one.
Комментарий
There are no comments made yet.
  • Страница :
  • 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. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories