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.
Blob Streams and Blob failures
Moderators: gto, cipto_kh, EgonHugeist
Hi,
I'm not sure I completely understand your problem but, did you try something like this:
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;
-
- Fresh Boarder
- Posts: 5
- Joined: 18.06.2010, 01:25
-
- Fresh Boarder
- Posts: 5
- Joined: 18.06.2010, 01:25
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.
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;
-
- Fresh Boarder
- Posts: 5
- Joined: 18.06.2010, 01:25