Problem with connection to DB2

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
softwestteam
Posts: 10
Joined: Fri 29 May 2009 10:43
Location: Romania, Arad

Problem with connection to DB2

Post by softwestteam » Thu 07 Apr 2011 08:34

I installed DB2 Express-C on my Delphi station. I create a new database and I try to connect my application to that database but I get this error

[IBM][CLIDriver] CLI0124E Invalid argument value. SQLSTATE=HY009

Uniconnection Configuration:

ProviderName=DB2;
Database=newdatabase;
host=localhost;
port=50000;
username:db2admin;
password=1;

What I'm doing wrong?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 08 Apr 2011 08:52

Hello,

Probably, the problem is connected with the database settings.
Please try to connect to your database over standard IBM DB2 Control Center, if you get the same error please check your database settings, otherwise contact us again.

softwestteam
Posts: 10
Joined: Fri 29 May 2009 10:43
Location: Romania, Arad

DB2 Control Center works

Post by softwestteam » Fri 08 Apr 2011 09:00

DB Control Center works.. I create databases, tables,users...but when I try to access a database with Unidac I get that error...

softwestteam
Posts: 10
Joined: Fri 29 May 2009 10:43
Location: Romania, Arad

Post by softwestteam » Sat 09 Apr 2011 14:43

I'm running out of time .. Help please?
Thanks

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 11 Apr 2011 08:59

Hello,

To solve the problem you should use your database alias instead of the server name like

UniConnection1.Server:= 'TOOLSDB';

softwestteam
Posts: 10
Joined: Fri 29 May 2009 10:43
Location: Romania, Arad

It work!

Post by softwestteam » Mon 11 Apr 2011 09:38

It work
Thanks a lot!!!

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 11 Apr 2011 09:51

Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.

softwestteam
Posts: 10
Joined: Fri 29 May 2009 10:43
Location: Romania, Arad

Post by softwestteam » Mon 11 Apr 2011 17:34

Hello
I have another problem
When I use a UniLoader I get this error.


[IBM][CLI Driver][DB2/NT] SQL0302N The value of a host variable in the EXECUTE or OPEN statement is out of range for its corresponding use.SQLSTATE=22001

The table that is loaded is very big (over 200.000 records)
With other database like Firebird, SQLite, PostgreSQL it work.

Thanks

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 12 Apr 2011 11:36

Hello,

I could not reproduce the problem.
I have tested it on a table with more than 200 000 records, and all works fine.
Maybe the problem isn't connected with the number of records, maybe it's connected with some values or types of fields in the table.
So please provide the script to create the table.

softwestteam
Posts: 10
Joined: Fri 29 May 2009 10:43
Location: Romania, Arad

Post by softwestteam » Tue 12 Apr 2011 12:38

I enlarged some string fields and everything it's working now.
It's interesting because I load a DBF table that have the exact structure as the DB2 table
Thanks a lot!!!
Last edited by softwestteam on Tue 12 Apr 2011 12:54, edited 1 time in total.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 12 Apr 2011 12:52

Hello,

Nice to hear that you solved the problem.

Post Reply