Hey, I know this is a few years later, but I'm hoping you can help me. I
have the same issue. I need to connect to an AS/400 system, but I'm not
familiar with ODBC or AS/400. I don't understand the error I'm getting...
require 'sequel'
db = Sequel.odbc(drvconnect: 'driver={IBM i Access ODBC
Driver};system=MYHOST;uid=MYUSERNAME;password=MYPASSWORD;')
tables = db[:QSYS2__SYSTABLES].where("TABLE_NAME like ?", "SYS%")
tables.each { |r| puts r[:table_name] }
#=> Sequel::DatabaseConnectionError: ODBC::Error: IM002 (0)
[unixODBC][Driver Manager]Data source name not found, and no default driver
specified
What's a "Data source name", and how do I specify it?
~Jeremy
On Friday, July 5, 2013 at 7:15:30 AM UTC-7, Wesley Staples wrote:
>
> Can anyone show me the correct syntax to use to make an odbc connection to
> an iseries / as400 database without using a DSN?
>
> I have tried Sequel.connect(:ADAPTER=>'odbc',:DRIVER=>'Client Access ODBC
> Driver (32-bit)',:SERVER=>'server ip',:UID=>'username',:PWD=>'pass') and I
> get the error message:
> c:/ruby192/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in
> `require': LoadError: no such file to load -- sequel/adapters/
> (Sequel::AdapterNotFound)
>
> The reson I need a DSN-less connection is so I can modify the "default
> library" parameter.
>
> if anyone can show me how to specify a library/file that would probably
> work too and I could just use a DSN. I have tried:
>
> tabl = DB["QSYS2/SYSTABLES"].where("something here")
> tabl = DB["QSYS2.SYSTABLES"].where("something here")
>
> any syntax I try results in an error like table qsys2/systables not found
> in library *libl
>
> I have to go into my dsn and set qsys2 to be the default library then use
> DB[:SYSTABLES] for it to work.
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.