Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #11  
Old 02-26-2010, 12:19 AM
delphimpd delphimpd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 701
Default

Include JPEG on the other form as well and see if it works
Reply With Quote
  #12  
Old 02-27-2010, 12:38 AM
Josh Josh is offline
Junior Member
 
Join Date: Feb 2010
Posts: 9
Default

It worts sort of.. Sometimes everything works correctly and as it should do. However, on some occasions it does not insert anything at all in the database just a blank entry which I cannot delete unless I go through access to delete it. Any suggestions on how to fix this??
Reply With Quote
  #13  
Old 02-27-2010, 02:39 AM
delphimpd delphimpd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 701
Default

when are you getting this error?
Reply With Quote
  #14  
Old 02-27-2010, 03:21 AM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default

Are you making sure that the stream actually has something loaded into it before using LoadFromStream? Check the stream's size, make sure you reset the Position to 0 first because some stream decendants don't reprot size correctly if you don't reset.
__________________
MrBaseball34

Hook 'em Horns
2005 College Football National Champions
2005 College Baseball National Champions
Reply With Quote
  #15  
Old 02-27-2010, 05:26 PM
delphimpd delphimpd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 701
Default

Can you please explain where are you getting this error (When), when you press or do what?
Reply With Quote
  #16  
Old 02-27-2010, 11:31 PM
Josh Josh is offline
Junior Member
 
Join Date: Feb 2010
Posts: 9
Default

Basically, when I click a button I can add in a new entry into the database. So when you click this button a new form loads where it is linked to the table using dbedit boxes you type whatever you want into the db edit boxes then click another button where you select the image you want to be added as well. Then click the done box at the bottom of this new form. It should show what I have entered in the database , however, occassionally it will just insert blank entries. Or it will enter in correctly but the image will not display when I click a new button.
Reply With Quote
  #17  
Old 02-28-2010, 03:21 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,059
Default

Create a new form "Form2" with a TImage & TADOQuery on it and use the bellow code:


Code:
procedure TForm1.Button1Click(Sender: TObject);
var
          oStream : TStream;
begin
          Form2 := TForm2.Create(self);
          Form2.ADOQuery1.Close;
          Form2.ADOQuery1.SQL.Clear;
          Form2.ADOQuery1.SQL.Add('select CompanyLogo from Table1');
          Form2.ADOQuery1.Open;

          oStream := Form2.ADOQuery1.CreateBlobStream(Form2.ADOQuery1.FieldByName('CompanyLogo'),bmRead);
          oStream.Seek(0, soFromBeginning);

          Form2.Image1.Picture.Bitmap.LoadFromStream(oStream);
          Form2.ShowModal;
          Form2.Free;

          oStream.Free;
end;
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #18  
Old 02-28-2010, 08:22 PM
Josh Josh is offline
Junior Member
 
Join Date: Feb 2010
Posts: 9
Default

Is this code to replace the previous add and load issue?
Reply With Quote
  #19  
Old 03-01-2010, 06:59 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,059
Default

This code is to load the image from the database and show it in a form.
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #20  
Old 03-01-2010, 11:07 AM
Josh Josh is offline
Junior Member
 
Join Date: Feb 2010
Posts: 9
Default

i tried this code, but i got a syntax error saying:

syntax error (missing operator) in query expression ' items '

how do i solve this?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:24 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.