1. Beatrix Willius
  2. Valentina Database ADK
  3. Mittwoch, März 06 2019, 09:45 AM
  4.  Abonnieren via E-Mail
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
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
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;
-- -------------------------------------------------------------
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
The only possible reason is - Not valid theRecID
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Sorry. Forgot the number: 529697.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Ah yes, got an idea what I might have done wrong.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Got it. Had the old RecID of the table plugged in instead of the new one.
Kommentar
There are no comments made yet.
  • Seite :
  • 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