Solved

TByteField

Posted on 1998-02-03
6
253 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

628 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