Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: mssql 2000

by EdwardG (Vicar)
on Feb 04, 2005 at 12:36 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-19 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found