<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="https://stackoverflow.com/questions/16991/what-ruby-ide-do-you-prefer">What Ruby IDE do you prefer?</a>  </p>
</blockquote>



<p>I'm making a <strong>simple</strong> script using ruby on a Windows 2003 Server.
My questions are:</p>

<ul>
<li>How can I connect to a database through ODBC?  I will be connecting to both <strong>Sybase on Solaris</strong> and <strong>MSSQL Server</strong>.</li>
<li>How can I send emails through an Exchange Server 2003?</li>
</ul>

<hr>

<h2>Update</h2>

<ul>
<li>What's the best simple IDE for Ruby scripting?  I currently use SciTE (which comes with Ruby)</li>
</ul>

There is an ODBC package for the
Ruby DBI module
available, or you can try to use the
ODBC binding for Ruby
, which also includes a Win32 binary.
Here an example that uses RDI (stolen from
here
):
```
```
require 'DBI'

# make an ODBC connection
conn = DBI.connect('DBI:ODBC:datasource','your_username','your_password')

# returns a list of the table names from your database
conn.tables

# returns an array with the resultset from your query
rs = conn.select_all('SELECT * FROM TheTable')
```
```
(ODBC datasources can be defined using the ODBC Administrator available via Control Panel/Administrative Tools.)
For e-mailing I would suggest you simply use the
standard mailing capabilities
of Ruby and connect to your Exchange Server through SMTP.
I cannot recommend you a Ruby IDE, though, as I do my text-editing with VIM. :-) Other people might be able to give you a hint on that.