Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2016-10-23 12:32 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.