連接SQL服務器我提到這個頁面紅寶石通過使用Windows身份驗證
http://www.codecapers.com/post/using-ruby-with-sql-server.aspx
我的代碼
DBI.connect('DBI:ADO:Provider=SQLNCLI;Data Source=SQLSERVER001;Integrated Security=True;Initial Catalog=DB001') do | dbh |
# Replace mytable with the name of a table in your database.
dbh.select_all('select top 1000 * from history where type="35" ') do | row |
puts row
end
end
,並試圖通過Windows身份驗證連接與SQL Server的紅寶石。但我有錯誤
無法加載驅動程序 'ADO'(基本錯誤:未初始化的常量DBI :: DBD :: ADO)
任何想法?
謝謝
這有幫助嗎? http://gordonotspanish.blogspot.com/2010/02/resolved-uninitialized-constant.html – ScottJShea 2012-02-24 00:39:32