# Sample code for ODBC

**URL:** <https://www.ruby-forum.com/t/sample-code-for-odbc/94348>\
**Category:** Rails\
**Created:** [May 1, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/sample-code-for-odbc/94348 "2006-05-01T14:17:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@alan](https://www.ruby-forum.com/u/alan)\
**Post date:** [May 1, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/sample-code-for-odbc/94348/1 "2006-05-01T14:17:15Z")

</div>

Hi,

I use Rails on windows.

Is there any sample that explains how to setup rails for connecting to  
an  
ODBC data source?

Thank you,  
Alan

---

<div class="post-metadata">

**Author:** ![alan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@alan](https://www.ruby-forum.com/u/alan)\
**Post date:** [May 1, 2006, 10:20pm UTC](https://www.ruby-forum.com/t/sample-code-for-odbc/94348/2 "2006-05-01T22:20:36Z")

</div>

Googles says:

[http://wiki.rubyonrails.org/rails/pages/ODBC](http://wiki.rubyonrails.org/rails/pages/ODBC)

last link on the page. Please use google or the forum search before  
asking for a question.

Thanks

Alan wrote:

> Hi,
> 
> I use Rails on windows.
> 
> Is there any sample that explains how to setup rails for connecting to  
> an  
> ODBC data source?
> 
> Thank you,  
> Alan

---

<div class="post-metadata">

**Author:** ![alan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@alan](https://www.ruby-forum.com/u/alan)\
**Post date:** [May 3, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/sample-code-for-odbc/94348/3 "2006-05-03T18:58:21Z")

</div>

Alan wrote:

> Hi,
> 
> I use Rails on windows.
> 
> Is there any sample that explains how to setup rails for connecting to  
> an  
> ODBC data source?

While there is a Ruby ODBC driver, for some reason there’s never been  
the demand for creating a Rails adapter - at least, not that I’m aware  
of. There have been times when I’ve wished for one, but it turned out  
that dumping the data across to MySQL was all that was needed for me…

---

<div class="post-metadata">

**Author:** ![alan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@alan](https://www.ruby-forum.com/u/alan)\
**Post date:** [May 3, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/sample-code-for-odbc/94348/4 "2006-05-03T18:58:30Z")

</div>

Alain wrote:

> Googles says:
> 
> [http://wiki.rubyonrails.org/rails/pages/ODBC](http://wiki.rubyonrails.org/rails/pages/ODBC)
> 
> last link on the page. Please use google or the forum search before  
> asking for a question.  
> While I sympathise with your sentiment, it’s a reasonable question. The  
> wiki page doesn’t mention a Rails adapter, nor does the last link on the  
> wiki page.

---

<div class="post-metadata">

**Author:** ![alan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@alan](https://www.ruby-forum.com/u/alan)\
**Post date:** [May 1, 2006, 11:21pm UTC](https://www.ruby-forum.com/t/sample-code-for-odbc/94348/5 "2006-05-01T23:21:00Z")

</div>

I did my homework and I knew about that link.

The problem that I cannot figureout is that we already have ODBC  
connectivity in ruby installation at this location:

C:\ruby\lib\ruby\site\_ruby\1.8\DBD\ODBC

Why do we need to install ruby-odbc-0.997.tar.tar again?

Alain wrote:

> Googles says:
> 
> [http://wiki.rubyonrails.org/rails/pages/ODBC](http://wiki.rubyonrails.org/rails/pages/ODBC)
> 
> last link on the page. Please use google or the forum search before  
> asking for a question.
> 
> Thanks
> 
> Alan wrote:
> 
> > Hi,
> > 
> > I use Rails on windows.
> > 
> > Is there any sample that explains how to setup rails for connecting to  
> > an  
> > ODBC data source?
> > 
> > Thank you,  
> > Alan
