Page 1 of 1

How to insert/load blob data

Posted: Tue 24 Jan 2012 14:59
by jouniaro
I have code that is trying to insert blob data into a blob field in a MySQL database.

I am using TMyQuery and TParam.LoadFromStream(MemoryStream, ftBlob), but I get an AV when the statement is executed with the following call stack

:007f1289 TDAParam.GetIsNull + $11
:00802742 TCustomDASQL.WriteParams + $A6
:00803158 TCustomDASQL.DefineProperties
:d68bd88b

The code is part of a generic component that works with different dataset types and works with other sets, such as TADOQuery.

Is this my problem or MyDAC's problem?

I am using MyDAC 7.1.4 in Delphi XE and XE2.

Posted: Wed 25 Jan 2012 08:39
by AndreyZ
Hello,

You must not use the TParam class, you have to use TDAParam class instead ( TDAParam.LoadFromStream(MemoryStream, ftBlob) )

Posted: Wed 25 Jan 2012 11:41
by jouniaro
It seems that the object is TDAParam in reality. I am getting it from TMyQuery.Params.

Posted: Wed 25 Jan 2012 11:48
by jouniaro
But LoadFromStream is not virtual, I see. I got it working now, ensuring TDAParam.LoadFromStream is used.

Thanks!

Posted: Wed 25 Jan 2012 12:10
by AndreyZ
It is good to see that the problem was solved. Feel free to contact us if you have any further questions about MyDAC.