# Connect to IBM\_DB with rubyscript2exe

**URL:** <https://www.ruby-forum.com/t/connect-to-ibm-db-with-rubyscript2exe/194796>\
**Category:** Ruby\
**Created:** [September 10, 2010, 9:00pm UTC](https://www.ruby-forum.com/t/connect-to-ibm-db-with-rubyscript2exe/194796 "2010-09-10T21:00:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adistarmid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Post date:** [September 10, 2010, 9:00pm UTC](https://www.ruby-forum.com/t/connect-to-ibm-db-with-rubyscript2exe/194796/1 "2010-09-10T21:00:07Z")

</div>

I have a ruby script that can connect to an IBM\_DB database and gather  
all the necessary information for my script to run, but once i use  
rubyscript2exe to create a .exe of the script it keeps saying that my  
database connection is false and wont connect.

any ideas as to what the problem is?

-Bobsmyph

---

<div class="post-metadata">

**Author:** ![adistarmid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Post date:** [September 10, 2010, 10:58pm UTC](https://www.ruby-forum.com/t/connect-to-ibm-db-with-rubyscript2exe/194796/2 "2010-09-10T22:58:55Z")

</div>

On 9/10/2010 1:01 PM, Bob S. wrote:

> I have a ruby script that can connect to an IBM\_DB database and gather  
> all the necessary information for my script to run, but once i use  
> rubyscript2exe to create a .exe of the script it keeps saying that my  
> database connection is false and wont connect.
> 
> any ideas as to what the problem is?
> 
> -Bobsmyph  
> First off, I highly recommend switching to OCRA  
> ([ocra | RubyGems.org | your community gem host](http://rubygems.org/gems/ocra)) over rubyscript2exe, as rubyscript2exe  
> has been discontinued for almost 3 years. That alone may fix your  
> issue.

If it doesn’t, could you provide more information, like the exact text  
of the error message and a small script that reproduces the problem?

---

<div class="post-metadata">

**Author:** ![adistarmid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Post date:** [September 16, 2010, 8:24pm UTC](https://www.ruby-forum.com/t/connect-to-ibm-db-with-rubyscript2exe/194796/3 "2010-09-16T20:24:26Z")

</div>

> First off, I highly recommend switching to OCRA  
> ([ocra | RubyGems.org | your community gem host](http://rubygems.org/gems/ocra)) over rubyscript2exe, as rubyscript2exe  
> has been discontinued for almost 3 years. That alone may fix your  
> issue.
> 
> If it doesn’t, could you provide more information, like the exact text  
> of the error message and a small script that reproduces the problem?

I have tried to install OCRA but keep getting a ton of errors.

## so i would like to be able to use what i had. below is a script that works when i run it as a .rb but when i make it a .exe through rubyscript2exe it no longer will connect to the DB. the DBname is cataloged if that makes any difference

require ‘mswin32/ibm\_db’

sql = “select \* from statement where row = ‘1’”  
dbh = IBM\_DB::connect(databaseName, “”, “”)  
sth = IBM\_DB::exec(dbh, sql)  
holdA = IBM\_DB::fetch\_array(sth)

## puts holdA[0]
