Error with InterBase and AssignConnect

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Error with InterBase and AssignConnect

Post by invent » Tue 07 Aug 2012 20:09

Hello,

I found a curious error in UniDAC and it's not easy to explain.

First my situation: I use Delphi 7 with UniDAC 3.50.0.13 and my software has to work with Interbase XE, Oracle 8.0.5 and Sql Server 2008 RC2.

I made a very strong (and long) sql-command and it works without errors with my 3 databases and TUniConnection.Connect. Than I put the code into a DLL and changed to TUniConnection.AssignConnect and suddenly the command failed with InterBase. It still works with Orcale and SQL-Server.

Here is an example of the code that doesn't works:

Code: Select all

select MYFIELD1, MYFIELD2, 1.0 as MYFIELD3, MYFIELD4 from MYTABLE
The error-message is:

Code: Select all

Dynamic SQL Error
SQL error code = -104
Invalid command
Data type unknown
When I change TUniConnection.AssignConnect to TUniConnection.Connect it also works with InterBase in the DLL.

Is there any parameter I have to set that AssignConnect works with InterBase XE?

Thanks in advance for any help.
Kind regards,
Gerd Brinkmann
invent GmbH

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Error with InterBase and AssignConnect

Post by ZEuS » Wed 08 Aug 2012 08:27

Unfortunately, we cannot reproduce the problem. Try to download and install the latest UniDAC version (4.3.8) and check, if the error appears with this version. If the problem persists, please create a small sample that demonstrates the problem, including a script to create the database and the table, and send it to eugeniyz*devart*com.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Re: Error with InterBase and AssignConnect

Post by invent » Wed 08 Aug 2012 09:52

Hello,

sorry, I forget an information for you: The error only appears in a command using "union". Example:

Code: Select all

select MYFIELD1, MYFIELD2, 1.0 as MYFIELD3, MYFIELD4 from MYTABLE1
union
select MYFIELD1, MYFIELD2, MYFIELD3, MYFIELD4 from MYTABLE2
MYFIELD3 in MYTABLE2 is a float-field (double precision).

BTW, it's not easy to me to change the UniDAC-version. It tooks 4 months to change my code from BDE to UniDAC. And for an UniDAC-update I need more than 1 week. So I only want to change when there is a real advantage for me in the new version.

When you still cannot reproduce this error, I will update. But this will be in september.

Kind regards,
Gerd Brinkmann
invent GmbH

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Error with InterBase and AssignConnect

Post by ZEuS » Wed 08 Aug 2012 11:56

We have reproduced the problem with your updated example.
The error is not due to AssignConnect, but due to the SQL statement itself. Such error is returned by InterBase when executing this SQL statement.
To avoid the error you should modify the SQL statement like this:

Code: Select all

select MYFIELD1, MYFIELD2, cast(1.0 as DOUBLE PRECISION) as MYFIELD3, MYFIELD4 from MYTABLE1
union
select MYFIELD1, MYFIELD2, MYFIELD3, MYFIELD4 from MYTABLE2
In this case InterBase does not generate the "Data type unknown" error.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Re: Error with InterBase and AssignConnect

Post by invent » Wed 08 Aug 2012 13:02

Hello and thanks for your fast reply. Please note the following 2 points:

1. You are not right, this is an error in AssignConnect. The same SQL command works with InterBase when i use TUniConnection.Connect instead of TUniConnection.AssignConnect. So the SQL statement cannot be wrong.

2. Please note that we are in the UniDAC forum. All SQL commands have to work with more than one database system. I don't believe that your solution works with Oracle or MS SQL Server.

Please fix this error. I will wait until the next version of UniDAC.

Kind regards,
Gerd Brinkmann
invent GmbH

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Error with InterBase and AssignConnect

Post by ZEuS » Fri 10 Aug 2012 08:58

We have reproduced the "Data type unknown" error with this SQL-statement using the default InteractiveSQL tool supplied with Interbase XE and with some other third-party database tools. By the way, the same SQL-statement does not cause any error when executed on Firebird 2.5. So, the error is not due to UniDAC at all, but is due to Interbase XE only.
UniDAC is the set of components that allows you to work with different databases and execute the same SQL-statements, but this does not mean that each database have to execute the same SQL-statement equally because each database has its own specificity.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Re: Error with InterBase and AssignConnect

Post by invent » Fri 10 Aug 2012 09:29

Hello,

please read my questions. All what you wrote is interesting but no answer.

This SQL statement has no errors with UniDAC and InterBase XE and TUniConnection.Connect!

The error is only by using AssignConnect.

So there must be a problem in TUniConnection.AssignConnect.

Kind regards,
Gerd Brinkmann
invent GmbH

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Error with InterBase and AssignConnect

Post by ZEuS » Tue 14 Aug 2012 12:58

Unfortunately we still can not reproduce the problem with the AssignConnect method.
Please try to reproduce the error in the UniDAC demo project located in the [the UniDAC demos folder]\Miscellaneous\Dll. The demo contains two projects: the main application and the DLL that uses the TUniConnection.AssignConnect method. Try to test your SQL-statement in the demo. If the problem persists, please write a script for creating the test database and test tables and send it to eugeniyz*devart*com.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Re: Error with InterBase and AssignConnect

Post by invent » Thu 16 Aug 2012 08:26

Hello,

it's no problem to make a demo-program, but I have no time. For the moment I don't use TUniConnection.AssignConnect. It's no real solution because InterBase needs in this case another licence.

Okay, I will sent you a demo some day in september.

BTW: I am unable to install the UniDAC-demos on my Windows 7 computer. Everything is installed, but no demo folder. On Windows XP no problem.

Kind regards,
Gerd Brinkmann
invent GmbH

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Error with InterBase and AssignConnect

Post by ZEuS » Fri 17 Aug 2012 07:16

On Windows 7, the version of UniDAC you are using installs its demo projects into the public documents folder that is usually located in the "\Users\Public\Documents\Devart" folder on the system drive.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Re: Error with InterBase and AssignConnect

Post by invent » Fri 17 Aug 2012 11:29

Hello,

thanks for this information. I found the files. "\Users\Public\Documents\..." is a folder that I don't use. Maybe it is an idea to ask the user, in which folder he wants to install the files.

Kind regards,
Gerd Brinkmann
invent GmbH

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Error with InterBase and AssignConnect

Post by ZEuS » Fri 17 Aug 2012 11:49

Yes, this is only due to previous versions of UniDAC, like one you are using.
The newer versions of UniDAC ask user in which folder UniDAC demo projects should be installed.

Post Reply