Error accessing Sqlite

A

Andrea Aaa

Hi, I've tried to access to a Sqlite database, or to create one, but the
result is always the same, when I execute this code:

require 'rubygems'
require 'sqlite3'
dir='C:\\Documents and Settings\\Andrea Marchese\\Desktop\\prova.db'
db = SQLite3::Database.open(dir)

db.execute( "select * from prova" ) do |row|
p row
end

db.close

it stops at the 4th line with this error:

c:/ruby/lib/ruby/1.8/dl/import.rb:29:in `initialize': unknown error
(RuntimeError)

from c:/ruby/lib/ruby/1.8/dl/import.rb:29:in `dlopen'

from c:/ruby/lib/ruby/1.8/dl/import.rb:29:in `dlload'

from c:/ruby/lib/ruby/1.8/dl/import.rb:27:in `each'

from c:/ruby/lib/ruby/1.8/dl/import.rb:27:in `dlload'

from
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2-mswin32/lib/sqlite3/driver/dl/api.rb:31

from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'

from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'

from
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2-mswin32/lib/sqlite3/driver/dl/driver.rb:1

... 9 levels...

from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/lib/ruby-debug.rb:90:in
`main'

from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/bin/rdebug-ide:74

from C:/ruby/bin/rdebug-ide:16:in `load'

from C:/ruby/bin/rdebug-ide:16

I don't know what to do.

Thanks for help!
 
G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

Hi, I've tried to access to a Sqlite database, or to create one, but the
result is always the same, when I execute this code:

require 'rubygems'
require 'sqlite3'
dir='C:\\Documents and Settings\\Andrea Marchese\\Desktop\\prova.db'
db = SQLite3::Database.open(dir)

db.execute( "select * from prova" ) do |row|
p row
end

db.close

it stops at the 4th line with this error:

c:/ruby/lib/ruby/1.8/dl/import.rb:29:in `initialize': unknown error
(RuntimeError)

from c:/ruby/lib/ruby/1.8/dl/import.rb:29:in `dlopen'

from c:/ruby/lib/ruby/1.8/dl/import.rb:29:in `dlload'

from c:/ruby/lib/ruby/1.8/dl/import.rb:27:in `each'

from c:/ruby/lib/ruby/1.8/dl/import.rb:27:in `dlload'

from

c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2-mswin32/lib/sqlite3/driver/dl/api.rb:31

from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'

from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'

from

c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2-mswin32/lib/sqlite3/driver/dl/driver.rb:1

... 9 levels...

from

c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/lib/ruby-debug.rb:90:in
`main'

from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/bin/rdebug-ide:74

from C:/ruby/bin/rdebug-ide:16:in `load'

from C:/ruby/bin/rdebug-ide:16

I don't know what to do.

Thanks for help!
Do you have the sqlite3 dll installed and visible in your path?
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top