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?


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?