Solved

TByteField

Posted on 1998-02-03
6
247 Views
Last Modified: 2010-05-18
How can i get the value of a TByteField in a dataset.

fieldtype in mssql = binary.

procedure TfrmFaxOut.tblxxxGetText(Sender: TField; var Text: String;
  DisplayText: Boolean);
begin
 x := Sender.Value;  // dont work !!!
end;

0
Comment
Question by:gipa
  • 3
  • 2
6 Comments
 

Author Comment

by:gipa
ID: 1358162
Edited text of question
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1358163
For binary data, you can use a TBlobField.
If this is what you want, then you can look at:
http://www.experts-exchange.com/topics/bin/ShowQ?qid=8630035244

What type is "x" in "x := Sender.Value"?

JB
0
 
LVL 2

Expert Comment

by:Waldek
ID: 1358164
What type is x
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Accepted Solution

by:
Waldek earned 50 total points
ID: 1358165
This may be a solution:
with field do
 begin
 if  not IsBlob then {Only for TByteFIeld}
   begin
    GetMem(Buffer,DataSize) //Must have a buffer with length datasize
 try
  if not GetData(Buffer) then // get a data from field
      messageDlg(' Field is NULL .........
    else
       // here Your work
   finally
     FreeMem(Buffer,DataSize);
 end;
end;
end;
0
 

Author Comment

by:gipa
ID: 1358166
Waldek ,
How can i pass the value (it should be 0 or 1)

procedure TfrmFaxOut.tblFAXOEXTRGetText(Sender: TField; var Text: String;
  DisplayText: Boolean);
var
  buffer : PChar;
begin
  with sender do begin
    if not IsBlob then {Only for TBytesField}
    begin
      GetMem(Buffer, DataSize); //Must have a buffer with length datasize
      try
        if not GetData(Buffer) then // get a data from field
          showmessage('Field is null')
        else
          // here Your work
          Text := xxx  <----- How can i pass the value (it should be 0 or 1)
      finally
        FreeMem(Buffer,DataSize);
      end;
    end;
  end;
end;

0
 
LVL 2

Expert Comment

by:Waldek
ID: 1358167
You may convert PChar to string and select Buffer[1] char
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now