Connect to a remote MS SQL database



Hello,

** First time posting, please excuse possible novice mistakes **

SETUP:
web server: win 32 Apache running on a windows 2003 server machine,
activePerl
database: MS SQL hosted on a separate windows server at my organization.

PROBLEM:
I cannot get my $dbh -> connect() line to work.

I have spent all day reading different documentation for DBI and DBD::ODBC,
as well as
different websites, and I can't make a connection.

Does anyone have experience with these Microsoft beasts?

Here is the sample code that I have hobbled together from different docs:

++++++++++++++++++++++++++++++++++++++++++++++++++++
use DBI;
use strict;
use diagnostics;

my $data_source = 'driver={SQL Server};Server=<server_name>;
database=<database_name>;uid=<username>;
pwd=<passwrd>;';

my $dbh = DBI->connect("dbi:ODBC:$data_source") or die "$DBI::errstr";
++++++++++++++++++++++++++++++++++++++++++++++++++++

I do not have the errors, because I do not have read access to the error
logs right now, and
CGI::carp is not working correctly.

Also, I checked and ODBC is listed as an available driver for DBI.


I would appreciate if anyone has some light to shed on the problem.


Thank you,

Jordan Mueller
Data Manager
Brigham and Women's Hospital


Relevant Pages

  • Re: Cant call method "prepare" on an undefined value
    ... Somehow you managed to have an undefined value instead of a DBI database handle in front of ->prepare, which is burried deep inside Oraperl.pm. ... Oracle HTTP Server at Server B. Both server are Solaris server. ... I have installed DBI and DBD into Server B and setup the oraperl in my perl script. ...
    (perl.dbi.users)
  • DBD::Oracle question
    ... I am trying to use DBI and DBD::Oracle to write a script that queries ... The server I am working on has multiple releases of Oracle on it, ... testing that my DBI call to open a database query will fail depending on ... ORACLE_HOME and other environmental variables set in my shell, ...
    (perl.dbi.users)
  • Find current database name from db handle
    ... I'm using a dbi handle that is shared between many packages in my ... Can I retrieve the current database name ... (without querying the server)? ...
    (perl.dbi.users)
  • Re: Where should I install Terminal server?
    ... It should go on a separate Windows server that does nothing but serve TS ... Don't turn your DC/Exchange box into a TS box in application ... > ISA server. ...
    (microsoft.public.windows.terminal_services)
  • Re: Installing SBS 2003
    ... you can (member servers or DCs). ... You need a separate Windows Server ... Javier [SBS MVP] ...
    (microsoft.public.windows.server.sbs)