Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection Ruby program to databse

Status
Not open for further replies.

invalid6363

Programmer
Mar 21, 2008
24
0
0
US
I have made a GUI application using Ruby\FXRuby and i would like to be able to connect it to a database to save the data that is entered in the application. It's a simple application that saves a person's contacts (name, address, email, etc.). I'm trying to use SQLite3 but i have not been able to find a tutorial on how to use it with Ruby.
Can anyone suggest a tutorial?
Thanks.
 
Hi

I use the SQLite/Ruby Interface like this :
Code:
[b]require[/b] [i]'sqlite3'[/i]

db = SQLite3::Database.new [i]'name.sqlite'[/i]

db.execute [i]'create table test ( name text, address text, email text )'[/i]

db.execute [i]'insert into test ( name, address, email ) values ( :name, :address, :email )'[/i], { [i]'name'[/i]=>namevar, [i]'address'[/i]=>addressvar, [i]'email'[/i]=>emailvar }

db.close
But I not found any tutorial.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top