Dbi connection

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

Hi,

I seem to be getting a connection

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’)

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

Aidy

On Jun 24, 11:50 am, Phlip [email protected] wrote:

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.

Thanks Phlip … I need shooting

Aidy