Uniloader error "Invalid variant type"

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Uniloader error "Invalid variant type"

Post by ertank » Mon 26 Sep 2016 12:10

Hi,

Using Delphi 10.1, UniDAC 6.4.14
I prepared a small test application. Can be downloaded from here: https://mega.nz/#!7xkn2LJD!2Gr177NabgHD ... TRrcLyB-Og

I am trying to import from a SQLite3 database into MSSQL database using TUniLoader.

In my SQLite query I am providing some fix values of type string. These string is manipulated as MEMO by UniQuery. And, UniLoader is raising subject error.

Moreover, having this error also causes some memory leak as follows:
Image

Any help is appreciated.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Uniloader error "Invalid variant type"

Post by azyk » Thu 29 Sep 2016 13:17

Thank you for the provided sample. We have reproduced the issue using it and are now investigating it. We will inform you as soon as any results are available.

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: Uniloader error "Invalid variant type"

Post by ertank » Tue 18 Oct 2016 21:12

Hi,

Is it known if there will be a fix included for this error for next release which planned to be in this month?

Thanks.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Uniloader error "Invalid variant type"

Post by azyk » Thu 17 Nov 2016 14:10

We have answered you at the following topic: viewtopic.php?f=28&t=34514

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: Uniloader error "Invalid variant type"

Post by ertank » Mon 28 Nov 2016 11:24

Hi,

I double checked. Unfortunately, subject error and leak still present in latest version 6.4.16

I have used same small test project at link provided in first post. SQL Servers test repeated are;
- SQL Server 2016 Express 64bit.
- SQL Server 2012 Express 64bit.

Error is same "Invalid variant type."

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: Uniloader error "Invalid variant type"

Post by ertank » Tue 06 Dec 2016 21:10

Hello,

I do appreciate a feedback about my last message before this one, please.

Thanks.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Uniloader error "Invalid variant type"

Post by azyk » Wed 07 Dec 2016 14:19

In the sent sample SQLite returns the Memo type to dataset-source for the AktarimTarihSaati field. But in TUniLoader the AktarimTarihSaati field has the DateTime type. When calling the TUniLoader.LoadFromDataSet method there is an error during the Memo type value conversion into the DateTime type and UniDAC returns the error 'Invalid variant type' which you get in the application.

To solve the issue set the DateTime type to the AktarimTarihSaati field in dataset-source, for example using Data Type Maping:

Code: Select all

qrySource.SQL.Add('from TERMINAL_SAYIM');
qrySource.DataTypeMap.AddFieldNameRule('AktarimTarihSaati', ftDateTime); // add code here
qrySource.Open();
Also we fixed memory leak occurrence. This fix will be included in the next UniDAC build. If you want to get this fix before the release, please tell us and we will send you a night build.

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: Uniloader error "Invalid variant type"

Post by ertank » Thu 08 Dec 2016 21:40

I confirm that using DataTypeMap.AddFieldNameRule() as indicated in above post solves TUniLoader error.

Regarding memory leak occurrence, I believe this is happening if there is an exception when running TUniLoader.LoadFromDataSet(). If this is the case, I can wait for next planned release.

If leak might occur during regular execution without error (I must tell I did not observe that) I would like to have a nightly build, please.

Thanks.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Uniloader error "Invalid variant type"

Post by azyk » Fri 09 Dec 2016 12:21

In your sample the memory leak cause was the 'Invalid variant type' error occurrence when calling the TUniLoader.LoadFromDataSet method. We fixed the memory leak when this error occurs. We sent a night build with this fix to your email.

Post Reply