Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TByteField

Posted on 1998-02-03
6
Medium Priority
?
254 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

721 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