Field type error with UniDac and NexusDB

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Emil1957
Posts: 12
Joined: Thu 04 Aug 2016 12:10

Field type error with UniDac and NexusDB

Post by Emil1957 » Thu 04 Aug 2016 12:37

Hi,
we are currently testing if we can extend our applications (using UniDAC) so that the users can also use NexusDB as a database (currently we support Access, Interbase, MSSQL, MySQL). I have created a small test app with a TUniConnection and a TUniQuery. The TUniQuery has persistent fields of type WideString.

For different providers (SQL Server...) I have created data type mappings. For example, a field which is created as "varchar" in a MSSQL Server database, but defined as WideString in the persistent field list of the query is correctly read. But I have problems to define the data type mappings for NexusDB:

The NexusDB test database was created with a SQL script with "varchar" data type. When i try to open the query using the NexusDB provider I get the error "different types for field XXX; expected: WideString, found: String" (the original message is in German). The problem is that I cannot find "string" or "varchar" in the column "Database type" in the Data Type Mapping dialog of the TUniConnection for NexusDB.

In the MSSQL test database, the same fields were also created as "varchar", if I map this type to WideString in the mapping dialog, I get no error when the query is opened.

So my question: Which "Database Type" I have to use for NexusDB in the Data Type Mapping dialog?

Emil1957
Posts: 12
Joined: Thu 04 Aug 2016 12:10

Re: Field type error with UniDac and NexusDB

Post by Emil1957 » Thu 04 Aug 2016 12:56

Hi,

I am one step further: I checked the field type in the NexusDB admin tool. There the varchar fields are shown as "NullString", this type I can find in the mapping dialog. But when I map "NullString" to "WideString" and open the query I get an error

Assertion failure:
(D:\Projects\Delphi\Dac\Common\Source\CRDataTypeMap.pas, Line 1492)

The funny thing ist that I don't have a D: drive on my machine.

Emil1957
Posts: 12
Joined: Thu 04 Aug 2016 12:10

Re: Field type error with UniDac and NexusDB

Post by Emil1957 » Thu 04 Aug 2016 13:04

Hi,
some more informations: If I delete the mapping list for NexusDB provider and also delete the persistent field list of the TUniQuery I can open the query without problem. But if the mapping list is not empty but the persistent field list is empty, the error occurs. There seems to be something wrong with the datatype mapping for NexusDB.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Field type error with UniDac and NexusDB

Post by ViktorV » Fri 05 Aug 2016 09:14

When using the NexusDB provider, in the Database type combobox in the Data Type Mapping dialog you should specify NexusDB type, not SQL type. See details about correspondence between SQL type and NexusDB type in NexusDB help: http://www.nexusdb.com/support/index.ph ... atypes.htm

Emil1957
Posts: 12
Joined: Thu 04 Aug 2016 12:10

Re: Field type error with UniDac and NexusDB

Post by Emil1957 » Fri 05 Aug 2016 12:49

I already found this solution (see my second post). But this lead to anotehr problem (see 2nd and 3rd post).

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Field type error with UniDac and NexusDB

Post by ViktorV » Fri 05 Aug 2016 12:50

We have already fixed the assertion error, the fix will be included in the next UniDAC build.

Emil1957
Posts: 12
Joined: Thu 04 Aug 2016 12:10

Re: Field type error with UniDac and NexusDB

Post by Emil1957 » Fri 05 Aug 2016 14:02

Hi,

thanks a lot!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Field type error with UniDac and NexusDB

Post by ViktorV » Fri 05 Aug 2016 14:07

Thank you for being interested in our products.
If you have any questions concerning our products, please don't hesitate to contact us - and we will try to help you resolve them.

Emil1957
Posts: 12
Joined: Thu 04 Aug 2016 12:10

Re: Field type error with UniDac and NexusDB

Post by Emil1957 » Tue 09 Aug 2016 08:08

Can you estmate when an update will be available?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Field type error with UniDac and NexusDB

Post by ViktorV » Tue 09 Aug 2016 08:16

We are going to release a new build of UniDAC including the fix next month.

Emil1957
Posts: 12
Joined: Thu 04 Aug 2016 12:10

Re: Field type error with UniDac and NexusDB

Post by Emil1957 » Tue 09 Aug 2016 12:12

Thank you, this is sufficient for me

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Field type error with UniDac and NexusDB

Post by ViktorV » Tue 09 Aug 2016 13:18

Thank you for being interested in our products.
If you have any questions concerning our products, please don't hesitate to contact us - and we will try to help you resolve them.

Post Reply