TMSParam.SetBlobData(Buffer: Pointer; Size: Integer);

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

TMSParam.SetBlobData(Buffer: Pointer; Size: Integer);

Post by Ludek » Mon 16 Mar 2009 09:10

this inherited method (from TParam) with pointer and size does not work any more in sdac 4.70.0.45 + d2009 (it worked fine with sdac 4.35.1.16 and d2006), leaves the parameter set to null.
Please, could you correct it?
Thanks, Ludek.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 18 Mar 2009 08:13

There are two overloads of the SetBlobData method: one in TParam that takes Pointer, and one in TDAParam that takes TBytes. In Delphi 2006 the overload with TBytes is called. In Delphi 2009 the overload with Pointer is called. You should change your code in the following way to call the correct overload:

Code: Select all

  MSQuery.Params[0].SetBlobData(TBytes(@s), 5);

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Post by Ludek » Thu 19 Mar 2009 07:10

I already change it few days before, but:
1. are there more such pitfalls between sdac 4.35.1.16 for d2006 and sdac 4.70.0.45 for d2009?
2. is it really not possible to make this old call work?
3. if not, at least some deprecated warning or hiding in private section would be nice... I know, such thing can't be done 100% safe (especially when someone retypes the TMSParam to TParam), but it could help show many wrong usages in source...

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 24 Mar 2009 10:23

We have fixed this problem. The fix will be included in the next build of SDAC.
The correct overload of SetBlobData is called after the fix, and explicit cast to TBytes is not required.

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Post by Ludek » Wed 25 Mar 2009 10:20

Thanks!

Post Reply