dbi connection

A

aidy

Hi,

Could anyone please tell me where I place the database name in this
connection string

require 'dbi'
server_name='test7'
dbh=DBI.connect("DBI:ADO:provider=SQLOLEDB;Data
Source=#{server_name};Integrated Security=SSPI") ?


I have tried

server_name='test7:Order'

But I get an 'invalid connection' exception.

Thanks

Aidy
 
A

aidy

Hi,

I seem to be getting a connection

<code>
require 'dbi'

server_name='test7'
db = 'Order'
dbh=DBI.connect("DBI:ADO:provider=SQLOLEDB;Data
Source=#{server_name};Intitial Catalog=#{db};Integrated
Security=SSPI")

if dbh
puts "connected"
else
puts "not connected"
end

dbh.execute('SELECT * FROM sys.Tables')

</code>

However, when I try to list all tables, I am receiving "Invalid
object name 'sys.Tables'.

Aidy
 
P

Phlip

aidy said:
Could anyone please tell me where I place the database name in this
connection string

require 'dbi'
server_name='test7'
dbh=DBI.connect("DBI:ADO:provider=SQLOLEDB;Data
Source=#{server_name};Integrated Security=SSPI") ?

At a guess, if you are using Windows - and if Windows still has a Control Panel
- go to it and configure a database provider. The real name goes in there, IIRC.
Then link to the provider under server_name.
 
A

aidy

At a guess, if you are using Windows - and if Windows still has a ControlPanel
- go to it and configure a database provider. The real name goes in there, IIRC.
Then link to the provider under server_name.

Thanks Phlip .... I need shooting

Aidy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,217
Latest member
topweb3twitterchannels

Latest Threads

Top