List Info

Thread: Integrating Watir with SQL Server 2000




Integrating Watir with SQL Server 2000
user name
2006-06-20 05:41:18
I'm having a problem with one of the projects i'm handling right now. I was asked to create automation scripts using watir that could also access SQL Server 2000.
Can anybody help me out with this???
I've read some of the posts here regarding database connectivity but it doesn't seem to work and I can't figure out how I can make them to work.
Please help me out guys. Thanks in advance...

Send instant messages to your online friends http://uk.messenger.yahoo.com

Integrating Watir with SQL Server 2000
user name
2006-06-20 08:07:55
I don't have experience with Ruby and SQL Server together,
however I
imagine the people who do have such experience will be more
willing to
respond if you tell them about what you have tried and the
errors/issues encountered.  Thanks.

Cheers,
Daniel.


On 20/06/06, jet iba˙fffff1ez <lovo_empireyahoo.com> wrote:
>
> I'm having a problem with one of the projects i'm
handling right now. I was
> asked to create automation scripts using watir that
could also access SQL
> Server 2000.
> Can anybody help me out with this???
> I've read some of the posts here regarding database
connectivity but it
> doesn't seem to work and I can't figure out how I can
make them to work.
> Please help me out guys. Thanks in advance...
>
>  Send instant messages to your online friends http://uk.messenger.yah
oo.com
> _______________________________________________
> Wtr-general mailing list
> Wtr-generalrubyforge.org
> htt
p://rubyforge.org/mailman/listinfo/wtr-general
>
>
_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
htt
p://rubyforge.org/mailman/listinfo/wtr-general
Integrating Watir with SQL Server 2000
user name
2006-06-20 13:28:18
Hi,
 
Try following Ruby code to connect to SQL Server. This uses ADO classes to connect to database.
 
require 'win32ole'

$rsOne = WIN32OLE.new('ADODB.Recordset')


puts "Start Time >> " << (Time.now).to_s

$con = WIN32OLE.new('ADODB.Connection')
$con['connectionstring'] = 'Test1' #DSN Name
$con.open

$rsOne = $con.execute('SELECT UserName FROM tblUser')

until $rsOne['eof'] == true and $rsTwo['eof']== true

puts $rsOne.Fields(0).Value

$rsOne.MoveNext()

end


Best Regards,
Unmesh

Daniel Browne <browne.danielgmail.com&gt; wrote:
I don't have experience with Ruby and SQL Server together, however I
imagine the people who do have such experience will be more willing to
respond if you tell them about what you have tried and the
errors/issues encountered. Thanks.

Cheers,
Daniel.


On 20/06/06, jet iba˙fffff1ez YAHOO.COM>wrote:
>
> I'm having a problem with one of the projects i'm handling right now. I was
> asked to create automation scripts using watir that could also access SQL
> Server 2000.
> Can anybody help me out with this???
&gt; I've read some of the posts here regarding database connectivity but it
> doesn't seem to work and I can't figure out how I can make them to work.
> Please help me out guys. Thanks in advance...
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
&gt; _______________________________________________
> Wtr-general mailing list
> Wtr-generalrubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
Integrating Watir with SQL Server 2000
user name
2006-06-20 14:42:32
require 'odbc'
c = ODBC::connect('odbc database name, 'user',
'password')
data = c.run("SELECT * FROM FOO")
data.each do |record|
puts record
end
c.disconnect

Post the code you tried with, please.
-Chris

On 6/19/06, jet iba˙fffff1ez <lovo_empireyahoo.com> wrote:
>
> I'm having a problem with one of the projects i'm
handling right now. I was
> asked to create automation scripts using watir that
could also access SQL
> Server 2000.
> Can anybody help me out with this???
> I've read some of the posts here regarding database
connectivity but it
> doesn't seem to work and I can't figure out how I can
make them to work.
> Please help me out guys. Thanks in advance...
>
>  Send instant messages to your online friends http://uk.messenger.yah
oo.com
> _______________________________________________
> Wtr-general mailing list
> Wtr-generalrubyforge.org
> htt
p://rubyforge.org/mailman/listinfo/wtr-general
>
>
_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
htt
p://rubyforge.org/mailman/listinfo/wtr-general
Spaces in paths
user name
2006-06-20 21:19:25
Hi all,

I'm trying to use cookiemanager to delete data between
test iterations but my paths contain spaces. I don't
have a problem getting the paths using
getSpecialFolderLocation but I get an error when I use
them with deleteSpecialFolderContents to try to delete
my cookies or my cache. 

As far as I can tell, this doesn't have anything to do
with Watir but I was hoping that someone here would
know since it's probably Windows-related.

Thanks

John

c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:6:in
`visit': uninitialized constant Dir::Find (NameError)
        from
c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:14:in
`rm_rf'

       from
c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:48:in
`delete
SpecialFolderContents'
        from C:/thread_testing/cookiemgr.rb:15 





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection
around 
http://mail.yahoo.com 
_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
htt
p://rubyforge.org/mailman/listinfo/wtr-general
Integrating Watir with SQL Server 2000
user name
2006-06-21 06:38:37
Hi, this is the code i've tried:
 
require 'dbi'

class Server
attr_reader :name
def initialize(name)
&nbsp; server_name=name
&nbsp; dbh=DBI.connect("DBI:ADO:Provider=SQLNCLI;Data
Source=#;Integrated Security=SSPI")
end

def databases
  db=Array.new
  dbh.select_all('SELECT name FROM master.sys.databases ORDER BY 1') do
| row |
 &nbsp; db.<<; Database.new(dbh,row[0])
  end 
  db
end
end

class Database
attr_reader :name
def initialize(dbh,name)
  dbh=dbh
&nbsp; name=name
end
end


server=Server.new("localhost")
server.databases.each {|x| p x.name}


Chris McMahon <christopher.mcmahongmail.com&gt; wrote:
require 'odbc'
c = ODBC::connect('odbc database name, 'user', 'password')
data = c.run("SELECT * FROM FOO")
data.each do |record|
puts record
end
c.disconnect

Post the code you tried with, please.
-Chris

On 6/19/06, jet iba˙fffff1ez YAHOO.COM>wrote:
>
> I'm having a problem with one of the projects i'm handling right now. I was
> asked to create automation scripts using watir that could also access SQL
> Server 2000.
> Can anybody help me out with this???
&gt; I've read some of the posts here regarding database connectivity but it
> doesn't seem to work and I can't figure out how I can make them to work.
> Please help me out guys. Thanks in advance...
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
&gt; _______________________________________________
> Wtr-general mailing list
> Wtr-generalrubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Send instant messages to your online friends http://uk.messenger.yahoo.com

Spaces in paths
user name
2006-06-21 06:39:56
>I'm trying to use cookiemanager to delete data between
test iterations but
my paths contain spaces.

What does your /code/ contain?

---Michael B.


_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
htt
p://rubyforge.org/mailman/listinfo/wtr-general
Integrating Watir with SQL Server 2000
user name
2006-06-21 06:43:39
Hi, thanks for the code but it doesn't seem to work either. Do I have to incorporate some other codes here or not. Ia pologize if 'm not that good with it coz I'm still just a newbie with watir...
 
Can you give me with detailed explanation or other things about integrating watir and SQL Server???

Unmesh Gundecha <upgundechayahoo.com&gt; wrote:
Hi,
 
Try following Ruby code to connect to SQL Server. This uses ADO classes to connect to database.
 
require 'win32ole'

$rsOne = WIN32OLE.new('ADODB.Recordset')


puts "Start Time >> " << (Time.now).to_s

$con = WIN32OLE.new('ADODB.Connection')
$con['connectionstring'] = 'Test1' #DSN Name
$con.open

$rsOne = $con.execute('SELECT UserName FROM tblUser')

until $rsOne['eof'] == true and $rsTwo['eof']== true

puts $rsOne.Fields(0).Value

$rsOne.MoveNext()

end


Best Regards,
Unmesh

Daniel Browne <browne.danielgmail.com&gt; wrote:
I don't have experience with Ruby and SQL Server together, however I
imagine the people who do have such experience will be more willing to
respond if you tell them about what you have tried and the
errors/issues encountered. Thanks.

Cheers,
Daniel.


On 20/06/06, jet iba˙fffff1ez YAHOO.COM>wrote:
>
> I'm having a problem with one of the projects i'm handling right now. I was
> asked to create automation scripts using watir that could also access SQL
> Server 2000.
> Can anybody help me out with this???
&gt; I've read some of the posts here regarding database connectivity but it
> doesn't seem to work and I can't figure out how I can make them to work.
> Please help me out guys. Thanks in advance...
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
&gt; _______________________________________________
> Wtr-general mailing list
> Wtr-generalrubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta._______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Send instant messages to your online friends http://uk.messenger.yahoo.com

Spaces in paths
user name
2006-06-21 17:37:24
Your error message does not suggest to me that the spaces in your path names is the problem.

Bret

On 6/20/06, John Fitisoff <yahoo.com"> jfitisoffyahoo.com> wrote:
Hi all,

I'm trying to use cookiemanager to delete data between
test iterations but my paths contain spaces. I don't
have a problem getting the paths using
getSpecialFolderLocation but I get an error when I use
them with deleteSpecialFolderContents to try to delete
my cookies or my cache.

As far as I can tell, this doesn't have anything to do
with Watir but I was hoping that someone here would
know since it's probably Windows-related.

Thanks

John

c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:6:in
`visit': uninitialized constant Dir::Find (NameError)
 &nbsp; &nbsp; &nbsp;  from
c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:14:in
`rm_rf'

 &nbsp; &nbsp;   from
c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:48:in
`delete
SpecialFolderContents'
&nbsp;   ; &nbsp; &nbsp;from C:/thread_testing/cookiemgr.rb:15





__________________________________________________
Do You Yahoo!?
Tired of spam? ; Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Wtr-general mailing list
rubyforge.org">Wtr-generalrubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Spaces in paths
user name
2006-06-21 18:35:45
<<Your error message does not suggest to me that the
spaces in your path names is the problem.>>

I think you're right. Although I'm not sure what to do
about it yet. I did find something here:

http://rubyforge.org/pipermail/wtr-general/2
005-November/004055.html

BTW, appreciate the previous help from you and the
others re: multi-instance. At this point, I think most
of my problem was a combination of IE and the app I
was writing tests for (so I'm now looking for some
automated way to clear the cache and remove all
cookies before each iteration). 

I basically decided to plow ahead and try to convince
my co-workers to adopt Watir regardless of whether or
not this particular problem gets solved. I'm hooked
and the response from others has been really good so
far.  

John



--- Bret Pettichord <bretpettichord.com> wrote:

> Your error message does not suggest to me that the
> spaces in your path names
> is the problem.
> 
> Bret
> 
> On 6/20/06, John Fitisoff <jfitisoffyahoo.com>
> wrote:
> >
> > Hi all,
> >
> > I'm trying to use cookiemanager to delete data
> between
> > test iterations but my paths contain spaces. I
> don't
> > have a problem getting the paths using
> > getSpecialFolderLocation but I get an error when I
> use
> > them with deleteSpecialFolderContents to try to
> delete
> > my cookies or my cache.
> >
> > As far as I can tell, this doesn't have anything
> to do
> > with Watir but I was hoping that someone here
> would
> > know since it's probably Windows-related.
> >
> > Thanks
> >
> > John
> >
> >
>
c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:6:in
> > `visit': uninitialized constant Dir::Find
> (NameError)
> >         from
> >
>
c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:14:in
> > `rm_rf'
> >
> >        from
> >
>
c:/ruby/lib/ruby/site_ruby/1.8/watir/cookiemanager.rb:48:in
> > `delete
> > SpecialFolderContents'
> >         from C:/thread_testing/cookiemgr.rb:15
> >
> >
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> > _______________________________________________
> > Wtr-general mailing list
> > Wtr-generalrubyforge.org
> > htt
p://rubyforge.org/mailman/listinfo/wtr-general
> >
> > _______________________________________________
> Wtr-general mailing list
> Wtr-generalrubyforge.org
> htt
p://rubyforge.org/mailman/listinfo/wtr-general


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection
around 
http://mail.yahoo.com 
_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
htt
p://rubyforge.org/mailman/listinfo/wtr-general
Spaces in paths
user name
2006-06-21 19:17:08
On 6/21/06, John Fitisoff <yahoo.com">jfitisoffyahoo.com> wrote:
I basically decided to plow ahead and try to convince
my co-workers to adopt Watir regardless of whether or
not this particular problem gets solved. I'm hooked
and the response from others has been really good so
far.

The cookie manager was contributed by Ati Ozgur and isn't really supported. It doesn't have any tests and no one is fixing bugs for it.

Bret

Spaces in paths
user name
2006-06-21 19:24:52
NP. I'll take a look at it and try to figure out why
it's failing.

Thanks

John

--- Bret Pettichord <bretpettichord.com> wrote:

> On 6/21/06, John Fitisoff <jfitisoffyahoo.com>
> wrote:
> >
> > I basically decided to plow ahead and try to
> convince
> > my co-workers to adopt Watir regardless of whether
> or
> > not this particular problem gets solved. I'm
> hooked
> > and the response from others has been really good
> so
> > far.
> 
> 
> The cookie manager was contributed by Ati Ozgur and
> isn't really supported.
> It doesn't have any tests and no one is fixing bugs
> for it.
> 
> Bret
> > _______________________________________________
> Wtr-general mailing list
> Wtr-generalrubyforge.org
> htt
p://rubyforge.org/mailman/listinfo/wtr-general


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection
around 
http://mail.yahoo.com 
_______________________________________________
Wtr-general mailing list
Wtr-generalrubyforge.org
htt
p://rubyforge.org/mailman/listinfo/wtr-general
[1-12]

about | contact  Other archives ( Real Estate discussion Medical topics )