Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Re: Connecting to a MS SQL 2k Server

by MrCromeDome (Deacon)
on Jul 24, 2003 at 22:06 UTC ( #277711=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Connecting to a MS SQL 2k Server
in thread Connecting to a MS SQL 2k Server

This sounds. . . interesting ;)

Is this a CGI app or a client/server app? If CGI, I take it this app is installed multiple times in multiple places? I'm just wondering why you need to have the different code. By using DBI, you can make it easy to switch between various databases and not have to change any code. Behold my untested (simple) example:

if($dbms eq "mysql") { $driver = "mysql"; $db = "test"; $user = "root"; $pw = ""; } elsif($dbms eq "mssql" { $driver = "ODBC"; $db = "test"; $user = "sa"; $pw = ""; } my $dbh = DBI->connect("DBI:$driver:$db", $user, $pw, { RaiseError => 1});
If you don't want to use ODBC, you might consider using DBD::Sybase. Haven't tried it, but SQL Server is derived from Sybase, so you might have some luck there.

Is this what you're looking for, or am I completely misunderstanding?

MrCromeDome

Replies are listed 'Best First'.
Re: Re: Re: Re: Connecting to a MS SQL 2k Server
by Eagle_f90 (Acolyte) on Jul 24, 2003 at 22:12 UTC
    It is a CGI script. Is a message board system for web masters. It is installed from a setup script and they choose what database to use, flatfile, mysql, mssql, ect. And depending on what database they use the program uses a differant .pm file. I am trying to avoid having the users install extra modules. It already is using the DBI module. I see in your above exampe that the $driver scaler is set to ODBC, is that also useing the DBD::ODBC module?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2021-03-01 10:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?