Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TByteField

Posted on 1998-02-03
6
Medium Priority
?
255 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Accepted Solution

by:
Waldek earned 150 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

916 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