Blob Streams and Blob failures

Forum related to MS SQL Server

Moderators: gto, cipto_kh, EgonHugeist

instinctfx.net
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 18.06.2010, 01:25

Blob Streams and Blob failures

Postby instinctfx.net » 13.04.2011, 07:51

Ladies and Gents,

Im having a real pain in the a** time trying to get a dataset to upload a blob.

SQL SERVER EXPRESS 2005 (win2k environment in a virtual machine)

This is the code:
[font=Courier New]

if not Locate('FIELDNAME', FRef, [loCaseInsensitive]) then
begin
Insert;
vS := tblGetPhoto.CreateBlobStream(GetPhotoIMAGE_DATA, bmWrite);
try
vS.Seek(0, soBeginning);
vS.CopyFrom(vUpload, vUpload.Size);
finally
FreeAndNil(vS);
end;

Post;

end;

[/font]

Now this same process and other types, works on other tables except this new table im working on.

Another image is uploaded to a separate table with no problems prior to this code executing, BUT when it comes time to upload the second image to the next table, it just skips over it as if there was nothing there (Yes there is image data in the stream).

Other fields in the table work fine except the varbinary field im trying to upload an image to in this table.

Any ideas why this would not be uploading to the blob field? Its just setting it to null.

No errors are raised either.

trupka
Expert Boarder
Expert Boarder
Posts: 140
Joined: 26.08.2007, 22:10

Postby trupka » 14.04.2011, 14:52

Hi,
I'm not sure I completely understand your problem but, did you try something like this:

Code: Select all

with ZQuery do
  begin
    Insert;
    TBlobField( fieldByName('the_blob')).LoadFromFile('THE_FILE');
    Post;
  end;

instinctfx.net
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 18.06.2010, 01:25

Postby instinctfx.net » 15.04.2011, 01:38

Ive tried that too to no avail.

For some reason the blob field refuses to put anything into it just on that table alone.

Weird issue that i cant seem to get around. Worst part is, its the last thing before release. Doh!

instinctfx.net
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 18.06.2010, 01:25

Postby instinctfx.net » 15.04.2011, 06:46

Just tried this bit of code from simple database editing tool I have and this code fails too!

I check the readonly state on the TBlobField and cannot figure out why this tables blob is being as ReadOnly True.

Code: Select all


      tblData.Edit;
      TBlobField(dbTextEdit.Field).LoadFromFile(vOpen.Filename);
      tblData.Post;

instinctfx.net
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 18.06.2010, 01:25

Postby instinctfx.net » 15.04.2011, 06:58

Ive even tried recreating the damned table.
I can save data to the other fields except the damned blog

trupka
Expert Boarder
Expert Boarder
Posts: 140
Joined: 26.08.2007, 22:10

Postby trupka » 19.04.2011, 10:49

I did few tests with current testing version and there is a bug with blob handling and ADO. Can you provide some simple example? I assume you used varbinary for blob data? What Delphi / Zeos version are you using?

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 19.05.2011, 21:51

instinctfx.net,
Did you try commenting out the first blob update? Maybe the problem is in setting two blobs?

Mark
Image


Return to “MS SQL Server”

Who is online

Users browsing this forum: No registered users and 1 guest