I'm not familiar with any ODBC library. You should use DBI if you want to go
this route which in turn has an ODBC driver.

http://www.kitebird.com/articles/ruby-dbi.html

-Charley

On 5/3/07, Venkata <[EMAIL PROTECTED]> wrote:

helo all,

   I am trying to connect to SQL server through ODBC.

Steps
1) I alreday have ODBC available.
2) Created a DSN and tested with Test connection there.
3) verified C:\IRBmain> Require 'ODBC' > true.

4) I created a scripts according to the examples.


require 'watir'
require 'ODBC'
include 'watir'
require 'Driver'

#~ # Connect to the Databse
conn = ODBC::connect('Myvalue','user','password')

#~ # get the from the table
h = conn.run("SELECT * FROM tableName where ssn = 'ssn'")


#~ # get the ecah field value and prints to the log.
h.each do |row|
puts row
end


it worked and retrieved the values one time.

Now it is not idetifying the ODBC anymore. i am getting Load error.

ruby DBconnect.rb
c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so: 127: The specified
procedure could not be found.
- Init_ODBC (LoadError)
c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so      from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from DBconnect.rb:2




Please can you help me.

do i have to disconnect? if it is please tell me how May be

ODBC::disconnect ?

Thanks,
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to