#1 2020-11-08 19:11:08

jairgza
Member
Registered: 2015-01-15
Posts: 10

NewTableFromRows problem

Hi all

I'm trying to export an statement from MSSQL to sqlite with this code:

    Result := DB3Conn.NewTableFromRows( ltable, rows, True, colsTypes );

It used to work well but I recently updated mormot sources and I'm getting this error

    EDatabaseError with message 'Field '' has no dataset'

Looking into the function found this line  "Rows.ReleaseRows;"  just before BindFromRows,   If comment this line it works.

Rows.ReleaseRows;

// write row data
Ins.BindFromRows(ColumnForcedTypes,Rows);
Ins.ExecutePrepared;
Ins.Reset;

Is it a bug ?


thanks

Last edited by jairgza (2020-11-09 00:05:14)

Offline

#2 2020-11-08 20:14:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: NewTableFromRows problem

It works on some DB, but not on others.
Which TSQLDBCOnnection class do you use to access MSSQL?

IIRC it was necessary to avoid memory leak.
Please try to find where ReleaseRows has been inserted, in the commit history.

Offline

#3 2020-11-09 00:04:57

jairgza
Member
Registered: 2015-01-15
Posts: 10

Re: NewTableFromRows problem

tested with 2 clases  TOleDBMSSQLConnectionProperties and TSQLDBFireDACConnectionProperties to connect to SQLServer Express 2014  (localhost win10),  Delphi 10.2 Upd3

ReleaseRows was inserted :

> File SynDB.pas
> check-in [a1dfe9124e] at 2020-03-22 11:06:28 on branch trunk
> {5875} reverted ISQLDBRows.RefCount check and introduced an explicit call to new ReleaseRows method

Offline

Board footer

Powered by FluxBB