Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: mssql 2000

by EdwardG (Vicar)
on Feb 04, 2005 at 12:36 UTC ( #428039=note: print w/ replies, xml ) Need Help??


in reply to mssql 2000

My module for ODBC connection to MSSQL -

package DBC::MSSQL; use DBI; use strict; sub new { return __PACKAGE__ } # see perlmonks node_id=183417 sub connect { my ($pointless, $details) = @_; my $server = $details->{server} || '(local)'; my $database = $details->{database} || 'master'; my $uid = $details->{uid} || $ENV{OSQLUSER} || 'sa'; my $pwd = $details->{password} || $ENV{OSQLPASSWORD} || ''; my $DSN = "driver=\{SQL Server\}; Server=$server; database=$database; uid=$uid; pwd=$pwd;"; DBI->connect("dbi:ODBC:$DSN") or die "$DBI::errstr\n"; } 1; =pod =head1 SYNOPSIS use DBC::MSSQL; my $dbh = DBC::MSSQL->connect( { server => '(local)', # optional database => 'pubs', # optional uid => 'sa', # optional pwd => '' # optional } ); $dbh->do("create table test (c char(1))"); =cut

 


Comment on Re: mssql 2000
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://428039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-12-26 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls