Using sql compact from ruby

L

lrlebron

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top