From: Post-no-reply Tudbc Date: 2008-09-16T06:30:45+09:00 Subject: Re: A new database access framework for any Ruby (Iron or J) Gustin Prudner wrote: > does Tudbc support Visual FoxPro tables? > > I"ve been searching for a good way to write back to VFP with Ruby for > awhile (the dbf gem does a great job reading from). > > thanks, > gustin > > On Sep 15, 12:50�am, Post-no-reply Tudbc It doesn't now. But TUDBC is designed for you to extend to support virtually any DBMSes. I don't have FoxPro myself, but I can give you some pointers. Here are the steps to extend for FoxPro: For FoxPro, because it is older, so my guess is the best route is to go through ODBC, and also because there is already support for Access ODBC, which should be similar enough that making it to work for FoxPro will require very minimal effort. (It looks like ODBC should also give you access to INSERT and UPDATE SQL which are for writing back to FoxPro. You should be able to user AutoGenerateIDs as well.) If you don't have ODBC driver for FoxPro, you can download from Microsoft website (search for "foxpro odbc" in google and you will see). Which Ruby are you using? * If you're using original Ruby, then you look at the Ruby source for ODBC. (You also need the latest version of Ruby ODBC driver from http://www.ch-werner.de/rubyodbc/. The binary version on their website is outdated and does not work properly, so you need to compile the latest on your own. Let me know if you need the binary that I compiled.) * If you're using JRuby, then look at DOTNET source for ODBC. * If you're using IronRuby, then look at Java source for ODBC. Then look at the file for Access ODBC, and create a class similar to it for FoxPro ODBC. Load your new class in TUDBCConfig_PreferredNative_AllProviders (for original Ruby, this class is stored in the file called TUF_TUDBC0_Ruby.rb). You can just do this thru learning-by-example, because you will see similar codes there. Then you should be ready to go by. How to use TUDBC after that? Watch speed-thru video to learn how to use TUDBC Assistant, and then use TUDBC Assistant to generate codes for you. Done. To be fair, you can do access FoxPro with or without TUDBC. But by using TUDBC, it will not require you to learn RubyODBC, which is relatively harder to learn, compared to the clean implementation of TUDBC. TUDBC also allows you to switch to other DBMSes in the future without change of codes. Let me know via support@xxx email if you need RubyODBC binary or if you run into trouble. Have fun! -- Posted via http://www.ruby-forum.com/.