-1

Possible Duplicate:
What Ruby IDE do you prefer?

I'm making a simple script using ruby on a Windows 2003 Server. My questions are:

  • How can I connect to a database through ODBC? I will be connecting to both Sybase on Solaris and MSSQL Server.
  • How can I send emails through an Exchange Server 2003?

Update

  • What's the best simple IDE for Ruby scripting? I currently use SciTE (which comes with Ruby)
Community
  • 1
  • 1
lamcro
  • 5,801
  • 17
  • 55
  • 70
  • This really is two separate questions, with the second one already answered many times on SO. – Jonke Nov 12 '08 at 19:45
  • http://stackoverflow.com/questions/256365/what-ide-editor-do-you-use-for-ruby-on-windows http://stackoverflow.com/questions/59968/best-editor-for-ruby – Jonke Nov 12 '08 at 19:48
  • Now this is really 3 questions. You should ask them seperately on SO. – Chris Pietschmann Nov 12 '08 at 23:31

4 Answers4

3

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.

Tomalak
  • 306,836
  • 62
  • 485
  • 598
1

For a Ruby IDE, try NetBeans.

epochwolf
  • 11,534
  • 13
  • 55
  • 69
  • NetBeans is one of the best IDEs I've ever used for any language, hands down. Its Ruby support is spectacular. – Robert K Nov 11 '08 at 13:57
  • I use NetBeans when I must use Windows or Linux. I use TextMate on my Mac. I don't need IDE support when I have a nice tool like that :) – epochwolf Nov 12 '08 at 14:22
1

For simple but powerful use ado and ruby on windows.This is a really good example.

Jonke
  • 6,417
  • 2
  • 22
  • 39
1

Be warned that the ODBC drivers included with the One-Click Installer for Ruby don't seem to be Unicode aware. (Accessing a SQL Server database from Unix, I used FreeTDS to convert UTF-16 to UTF-8 prior to getting it from UnixODBC.) I haven't been able to make a similar conversion in Windows.

Austin Ziegler
  • 715
  • 9
  • 15