larwilliams has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'm trying to use DBD::ADO to connect to a MS SQL Server. Anyways, i was wondering if i could specify the database name in the connection string. Like, for example:
$mssql_dbh = DBI->connect("DBI:ADO:DSN;database=database","User","password");
Thanks to anyone who can help :)
  • Comment on Selecting MS SQL database using DBD::ADO

Replies are listed 'Best First'.
Re: Selecting MS SQL database using DBD::ADO
by mpeppler (Vicar) on Mar 08, 2002 at 01:29 UTC
    A quick look at the DBD::ADO docs show a "DefaultDatabase" connection attribute.

    I'd try with that...

    Michael

      Could you please email a copy of the documentation to lawrence_cecil_williams@hotmail.com? I cannot access Telnet to run perldoc and i've been unable to find it in the online documentation. Thanks :)
        You can easily find the docs on the net. Go to search.cpan.org and enter DBD::ADO. This will list the modules that correspond to the search, and includes links to the docs.

        Michael

Re: Selecting MS SQL database using DBD::ADO
by Anonymous Monk on Mar 08, 2002 at 12:14 UTC
    I've found it :)