Yes, it works, but I have to change Uid as User ID, Pw as password.

Thanks.
Wesley Chen.
For life, the easier, the better.


On Fri, Oct 30, 2009 at 4:53 PM, SMF SMF <[email protected]> wrote:

> Hi Pritam,
>
> No problem. Could you please do one favor, can you post the
> steps/configuration you followed to connect to database that will helpful to
> others also.
>
> Thanks,
> smf
>
> On Fri, Oct 30, 2009 at 1:58 PM, Pritam <[email protected]> wrote:
>
>>
>>
>> Hi,
>>
>> Thank you very much.....now am able to connect to the database and
>> retrieve the data...
>>
>> Thanks again.
>>
>>
>>
>> On Oct 30, 12:25 pm, SMF SMF <[email protected]> wrote:
>> > you have to download the dbi files and configure them on your machine.
>> >
>>  > On Fri, Oct 30, 2009 at 12:30 PM, Pritam <[email protected]> wrote:
>> >
>> > > Hi,
>> >
>> > > Thank you for your reply.
>> >
>> > > I have executed the code that you have given, but i got the following
>> > > error.
>> >
>> > > C:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:368:in `load_driver': Could not
>> > > load driver (no such file to load -- C:/Ruby/lib/ruby/site_ruby/1.8/
>> > > dbd/ADO) (DBI::InterfaceError)
>> > >        from C:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:233:in
>> `_get_full_driver'
>> > >        from C:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:219:in `connect'
>> > >        from database.rb:5
>> >
>> > > I went to the location(C:/Ruby/lib/ruby/site_ruby/1.8/dbd/) as
>> > > indicated in the error, and could find only find ODBC  and Proxy
>> > > folders and not ADO.
>> > > Do i need to download and copy the ADO.rb file in this location in
>> > > order to access the SQL database?
>> > > If yes, where can i find this file...
>> >
>> > > Thanks in advance
>> >
>> > > On Oct 29, 4:56 pm, SMF SMF <[email protected]> wrote:
>> > > > Hi Pritam,
>> >
>> > > > Answer to your *question 1.*
>> >
>> > > > require 'dbi'
>> > > > DB =
>> >
>> > >
>> "Provider=SQLOLEDB.1;Server=<servername>;Database=<DBname>;Uid=userid;Pw=password"
>> > > > sql = "select LoginID from Login WHERE UserName ='xyz'"
>> > > > DBI.connect("DBI:ADO:#{DB}") do | dbh |
>> > > >     dbh.select_all( sql ) do |row|
>> > > >         puts row[0]  # the first field
>> > > >         #puts row[1]  # the second field
>> > > >     end
>> > > > end
>> >
>> > > > No idea, about framework or architecture
>> >
>> > > > ----
>> > > > Thanks
>> >
>> > >  > On Thu, Oct 29, 2009 at 5:03 PM, Pritam <[email protected]>
>> wrote:
>> >
>> > > > > Hi guys,
>> >
>> > > > > I am new to ruby programming, and I need help in developing data
>> > > > > driven framework which uses sql database for retrieving data. I
>> have
>> > > > > seen a lot of examples over internet which showed how to do it
>> using
>> > > > > excel and open source applications.
>> >
>> > > > > To start with I need information for the following.
>> >
>> > > > > 1. How to connect to a sql database using ruby/watir scripts?
>> > > > > 2. What sought of architecture am I looking for?
>> >
>> > > > > Thanks in advance.
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to