[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Using sql compact from ruby

lrlebron@gmail.com

12/17/2007 2:40:00 PM

Does anyone have any experience using Sql Compact with Ruby. I tried
the following code
require 'dbi'

@server_name='C:/Temp/F1Backup.sdf'
@dbh=DBI.connect("DBI:ADO:Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data
Source=#{@server_name}")

if @dbh
puts "connected"
else
puts "not connected"
end

and received the following error message
c:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb:57:in `connect': Open
(DBI::DatabaseError)
OLE error code:80004005 in Microsoft OLE DB Provider for ODBC
Drivers
[Microsoft][ODBC Driver Manager] Data source name not found and
no default driver specified
HRESULT error code:0x80020009
Exception occurred. from c:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:
424:in `connect'
from c:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:215:in `connect'
from sqlCompact.rb:4

Thanks,
Luis