Recent

Author Topic: [Solved] Connect to IBM DB2 without DSN  (Read 2888 times)

schumi

  • New Member
  • *
  • Posts: 40
[Solved] Connect to IBM DB2 without DSN
« on: January 12, 2022, 09:41:29 am »
Hi,
it's possible to connect to IBM DB2 with ODBC driver without DSN ?
with ZeosLib it's possible?

windows or linux

thank's
« Last Edit: January 19, 2022, 06:10:13 pm by schumi »

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: Connect to IBM DB2 without DSN
« Reply #1 on: January 12, 2022, 03:59:17 pm »
Hi,
it's possible to connect to IBM DB2 with ODBC driver without DSN ?
with ZeosLib it's possible?

windows or linux

thank's

Did you know that Zeos has their own support forum? https://zeoslib.sourceforge.io/
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

Zvoni

  • Hero Member
  • *****
  • Posts: 2319
Re: Connect to IBM DB2 without DSN
« Reply #2 on: January 17, 2022, 12:28:14 pm »
No idea about Zeos, but i connect to a DB2 without DSN using TODBCConnection just fine.
The pitfall i noticed is the connection-String.
Don't use the SERVER-Variable, but SYSTEM

"DRIVER={iSeries Access ODBC Driver};SYSTEM=10.1.1.2;UID=myUsername;PWD=myPassword"
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

schumi

  • New Member
  • *
  • Posts: 40
Re: Connect to IBM DB2 without DSN
« Reply #3 on: January 19, 2022, 06:09:45 pm »
with ZeosLib 8.0 it should be possible to connect to IBM DB2 using ODBC or OLEDB.

with TODBCConnection
conn.UserName := 'user';
conn.Password := 'password';
conn.Driver := 'iSeries Access ODBC Driver';
conn.Params.Add('SYSTEM=10.0.x.x');
conn.Open ;           

thanks to all

 

TinyPortal © 2005-2018