Search found 10 matches

by jangbu
Thu 18 Nov 2021 08:06
Forum: SQL Server Data Access Components
Topic: SDAC 10.0.1 for Delphi 11
Replies: 1
Views: 19224

SDAC 10.0.1 for Delphi 11

Hi,
just installed SDAC 10.0.1 for Delphi 11. Created a new VCL application with TMSConnection and TMSQuery. DBAccess and MemDS wil not be found? The same works well at prevered Delphi Version 10.4.2 with SDAC 10.0.1?
Why that both Units wil not be found? I allready reinstalled UNIDAC 9.0.1 and SDAC 10.0.1 for Delphi 11 multiple.
BR
Jens
by jangbu
Mon 18 Oct 2021 09:20
Forum: Universal Data Access Components
Topic: UNIDAC FMX Android
Replies: 2
Views: 2610

Re: UNIDAC FMX Android

I just reinstalled UNIDAC 9.0.1 as full installation with all components, now unit UNI will be found. Before I just selected only MSSQL-Server components. Which component I actualy need to select while installation to install the unit UNI?
jangbu
by jangbu
Fri 15 Oct 2021 10:44
Forum: Universal Data Access Components
Topic: UNIDAC FMX Android
Replies: 2
Views: 2610

UNIDAC FMX Android

Hi, I'm currently changing from SDAC to UNIDAC. In my (Delphi 10.4.2) FMX applications for Android i used TMSConnection and TMSQuery. I replaced it by UNIConnection and UNIQuery. Compiled for Windows it works but when I try to compile for Android the Unit "Uni" can not be found?
jangbu
by jangbu
Wed 16 Jun 2021 09:04
Forum: Universal Data Access Components
Topic: migration SDAC to UNIDAC
Replies: 1
Views: 884

migration SDAC to UNIDAC

Hi,
I'm using Delphi SDAC component to connect to MS-SQL. Because soon need to connect to MySQL too I bought UNIDAC components for Delphi.
I'm just tried to install UNIDAC additional to my already installed SDAC Delphi system but it is not alowed. I just need to deinstall SDAC at first.
Here my question: When deinstall SDAC and install UNIDAC all my exisitend projects will run into an error and i need to exchange manually in all my sources the Connection, Table and Query components or is there a automatically funtion to do that?

jangbu
by jangbu
Mon 29 Jun 2020 16:20
Forum: SQL Server Data Access Components
Topic: Delphi FMX save blob to MSSQL
Replies: 11
Views: 11022

Re: Delphi FMX save blob to MSSQL

Great, that works fine!
many thanks!!!
by jangbu
Mon 29 Jun 2020 13:06
Forum: SQL Server Data Access Components
Topic: Delphi FMX save blob to MSSQL
Replies: 11
Views: 11022

Re: Delphi FMX save blob to MSSQL

I got a bit further.
With FMX + SDAC stored images as blob field can be read back from DB only with FMX application using this code:

Code: Select all

procedure TForm2.btn_save_to_DBClick(Sender: TObject);
var
  MStream : TMemoryStream;
begin
  MStream := TMemoryStream.Create;
  try
    MSQuery1.SQL.Text := 'INSERT INTO sign (ID,image1,DateTime,ok) VALUES (:ID,:image1,:DateTime,:ok)';
    Image1.Bitmap.SaveToStream(MStream)
    MStream.Seek(0,0);
    try
      MSQuery1.ParamByName('ID').AsInteger := 109;
      MSQuery1.ParamByName('image1').LoadFromStream(MStream, ftBlob);
      MSQuery1.ParamByName('DateTime').AsDateTime := now;
      MSQuery1.ParamByName('ok').AsBoolean := false;
      MSQuery1.ExecSQL();
    except
      on E: Exception do
        ShowMessage('Error on ExecSQL! ' + e.Message);
    end;
    MStream.Free;
  finally
    MSQuery1.Close;
  end;
end;

procedure TForm2.btn_read_from_DBClick(Sender: TObject);
var BlobStream : TStream;
begin
  if not MSConnection1.Connected then
    MSConnection1.Connected := true;
    try
      MSQuery1.Close;
      MSQuery1.SQL.Clear;
      MSQuery1.SQL.Add('select * from sign where id = ''' + edt_id.Text + '''');
      MSQuery1.Open;
      BlobStream := MSQuery1.CreateBlobStream(MSQuery1.FieldByName('image1'),TBlobStreamMode.bmRead);

      Image3.Bitmap.LoadFromStream(BlobStream); // FMX version

      BlobStream.Free;
    except
      on E: Exception do
        ShowMessage('Fehler bei lesen blob from DB ' + e.Message);
    end;
end;
But when I'm using this windows-VLC application code to read the blob field from back from DB, I get the message:
"DB Bitmap is invalid"

Code: Select all

procedure TfrmMain.btn_read_from_DBClick(Sender: TObject);
var BlobStream : TStream;
begin
  if not MSConnection1.Connected then
    MSConnection1.Connected := true;
    try
      MSQuery1.Close;
      MSQuery1.SQL.Clear;
      MSQuery1.SQL.Add('select * from sign where id = ''' + edt_id.Text + '''');
      MSQuery1.Open;
      BlobStream := MSQuery1.CreateBlobStream(MSQuery1.FieldByName('image1'),TBlobStreamMode.bmRead);

      Image2.Picture.Bitmap.LoadFromStream(BlobStream);  // VCL version

      BlobStream.Free;
    except
      on E: Exception do
        ShowMessage('Fehler bei lesen blob from DB ' + e.Message);
    end;
end;
What's the problem to read blob fields (images) back from DB with windows VCL application, that has been stored in DB by FMX android application?
jangbu
by jangbu
Sat 27 Jun 2020 14:47
Forum: SQL Server Data Access Components
Topic: Delphi FMX save blob to MSSQL
Replies: 11
Views: 11022

Re: Delphi FMX save blob to MSSQL

when I open your link at first i have to log in to devart forum with my account but at next I get the message from your website: https://www.devart.com/company/contactform.html

We are sorry, the page you requested cannot be found

Where can i send my documented sample to?
by jangbu
Wed 24 Jun 2020 16:45
Forum: SQL Server Data Access Components
Topic: Delphi FMX save blob to MSSQL
Replies: 11
Views: 11022

Re: Delphi FMX save blob to MSSQL

your site: devart.com/company/contactform.html is not reachable:
-> "We are sorry, the page you requested cannot be found"?
jangbu
by jangbu
Mon 22 Jun 2020 19:03
Forum: SQL Server Data Access Components
Topic: Delphi FMX save blob to MSSQL
Replies: 11
Views: 11022

Re: Delphi FMX save blob to MSSQL

I'm using this (VCL) code in my windows application to read stored blob fileds (photos) from DB.
In that windows VCL application I'm using ADOConnection, AdoQuery, DataSource, DBImage to read Data from DB.

Code: Select all

procedure TForm3.btn_selectClick(Sender: TObject);
var sql_str : string;
begin
  AdoQuery1.Close;
  AdoQuery1.SQL.Clear;
  sql_str := 'select * from sign where id = ''' + edt_id.Text + '''';
  AdoQuery1.SQL.Add(sql_str);
    AdoQuery1.Open;
  if AdoQuery1.RecordCount = 0 then
    ShowMessage('id not fond');
end;
Is my FMX code to store Blobfiled in DB (Android) ok?

Who can I store blob fields in MS-SQL with FMX application on android device by using DEVART SDAC (9.2.4) components?
by jangbu
Sun 21 Jun 2020 09:53
Forum: SQL Server Data Access Components
Topic: Delphi FMX save blob to MSSQL
Replies: 11
Views: 11022

Delphi FMX save blob to MSSQL

Hi, I'm trying to save an Image taken from android smartphone camera to MSSQL. I'm using Delphi 10.3.3. and SDAC 9.2.4.
The record will be stored in DB wihout error. But when I try to read it from DB I get this message: "not supported stream format". The same code used in VCL application on windows PC an internal camera and Ado-Query works fine!

How can I store an camera Image to MSSQL-DB in Delphi FMX application running at Android smartphone?


Code: Select all

procedure TfrmMain.SaveImage_in_DB(Sender: TObject);
var MStream: TMemoryStream;
  sql_str : string;
  _rec_cnt : integer;
begin

  MStream := TMemoryStream.Create;
  try

    ADOQuery1.Close;
    ADOQuery1.SQL.Clear;
    sql_str := 'select * from sign';
    ADOQuery1.SQL.Add(sql_str);
    ADOQuery1.Open;

    if ADOQuery1.RecordCount > 0 then
      _rec_cnt := ADOQuery1.RecordCount;

    MStream.Position := 0;

    //  Image1.Bitmap.SaveToStream(MStream);  -> FMX-Variante !!!!
    //  Image1.Picture.SaveToStream(MStream); -> VCL-Variante !!!!

    imgProfile.Picture.SaveToStream(MStream);
    MStream.Position := 0;

    ADOQuery1.Append;

    ADOQuery1.FieldByName('ID').AsInteger := _rec_cnt + 1;
    ADOQuery1.FieldByName('DateTime').AsDateTime := now;
    TBlobField(ADOQuery1.FieldByName('image1')).LoadFromStream(MStream);

    ADOQuery1.Post;
    ADOQuery1.Close;
  except
    on E: Exception do
    begin
      ShowMessage('Error: ' + E.ClassName + ' ' + E.Message);
    end;
  end;
  MStream.Free;
end;
jangbu