[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Error accessing Sqlite

Andrea Aaa

7/12/2008 3:20:00 PM

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!
--
Posted via http://www.ruby-....

1 Answer

Glen Holcomb

7/14/2008 4:25:00 PM

0

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

On Sat, Jul 12, 2008 at 9:20 AM, Andrea Aaa <marchese58@libero.it> wrote:

> 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!
> --
> Posted via http://www.ruby-....
>
>
Do you have the sqlite3 dll installed and visible in your path?

--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)