1. Beatrix Willius
  2. Valentina Database ADK
  3. 水, 3月 06 2019, 09:45 AM
  4.  メールで購読
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