#1 mORMot 1 » TSynDBDataSet raise error "insufficient memory for this operation" » 2017-06-22 10:16:35

ken
Replies: 1

Code:

procedure TForm1.Button1Click(Sender: TObject);
begin
  with TSynDBDataSet.Create(Self) do
  begin
    Connection := fProps; // connect sql server2008
    CommandText := 'Select * From LogInfo'; // LogInfo has more then 100000 rows.
    IgnoreColumnDataSize := true;
    Open; // raise error: insufficient memory for this operation.
  end;
end;

But i use TADOQuery or TFDQuery. It's OK.For example:

procedure TForm1.Button1Click(Sender: TObject);
begin
  with TADOQuery.Create(Self) do
  begin
    Connection := fADOCon;
    SQL.Text := 'Select * From LogInfo';
    Open; // It's OK
  end;
end;

#3 mORMot 1 » How reconnect to remotely DB » 2017-06-05 02:28:54

ken
Replies: 2

I use TSQLDBWinHTTPConnectionProperties to access remotely DB. Connection success.
But sometimes the network is disconnected.For a while,network is connected.
How reconnect to remotely DB?

#4 mORMot 1 » Raise error with message '0.41841' is a not valid timestamp » 2017-06-04 04:09:15

ken
Replies: 1

I am bad english. Sorry

Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
  with TSynDBDataSet.Create(Self) do
  begin
    Connection := fProps; // connect sql server2008
    CommandText := 'Select CardID,CardName,CreDate From Card'; // datatype: CardID int, CardName nvarchar(50), CreDate datetime
    IgnoreColumnDataSize := true;
    Open;

    First;
    while not Eof do
    begin
      Memo1.Lines.Add(FieldByName('CardID').AsString);
      Memo1.Lines.Add(FieldByName('CardName').AsString);
      Memo1.Lines.Add(FieldByName('CreDate').AsString); // raise error: '0.41841' is a not valid timestamp

      Next;
    end;
  end;
end;

#5 Re: mORMot 1 » How to connect oracle by SynDBOracle » 2016-08-23 10:08:06

ken

Thank you for your help!
I didn't install Oracle client. I can run now.

But several conditions must be met:
1 Executable file must be 32 bits.
2 In the directory with the executable,must contain four files :oci.dll,oraociei12.dll,oraons.dll,msvcr100.dll.

#6 mORMot 1 » How to connect oracle by SynDBOracle » 2016-08-19 01:23:06

ken
Replies: 3

procedure TForm1.btn1Click(Sender: TObject);
var
  Lv_Rows : ISQLDBRows;
begin
  Lv_Rows := fProps.Execute('select * from dual',[],nil); //here has error. Error message is "TSQLDBOracleLib error:"
  while Lv_Rows.Step do
    mmo1.Lines.Add(ColumnString(0));
end;

initialization
   fProps := TSQLDBOracleConnectionProperties.Create('//192.168.1.221:1521/mes','','userid','pwd');

finalization
  fProps.free;

OCI.dll is in the same directory with the application.

#7 mORMot 1 » Abort HTTPApiServer.LogStart » 2016-07-15 08:50:52

ken
Replies: 1

For example

  fServer.LogStart('c:\log',hltW3C,'',hlrDaily,0,[hlfData..hlfSubStatus],[hlfLocalTimeRollover,hlfUseUTF8Conversion]);

  In the log file,time is not local time.

#8 mORMot 1 » Abort type PPtrInt » 2016-07-15 08:34:53

ken
Replies: 1

This type declared in SynCommons and SynCrtSock.But they are not incompatible.

For example

Uses SynCrtSock, SynCommons ;

function XX(Arows : ISQLDBRows) : RawUTF8;
var
  Lv_Pint : PPtrInt;//error
  Lv_Pint : SynCommons.PPtrInt;//ok
begin
  result := Arows.FetchAllAsJson(True,Lv_Pint,True); 

  .....
end;

Board footer

Powered by FluxBB