My env:
TS 6.7.2 on RedHat Linux
DB: MS SQL
ODBC Drivers:unixODBC and freeTDS with DBI
I am trying to populate a drop down list in a form using an inline ipl script which connects to a remote database server. When I run the script on the command line as myself it works fine. When running through inline, the connection fails with the error pasted below.
I am setting the environment variables also properly as shown below.
Has anybody encountered such error?
please provide inputs.
Part of my datacapture.cfg file that calls the ipl script:
< inline command="/Interwoven/TeamSite/iw-perl/bin/iwperl /Interwoven/TeamSite/httpd/iw-bin/connect ToDb.ipl" / >
my perl script connectToDb.ipl
#!/Interwoven/TeamSite/iw-perl/bin/iwperl -w
#This is a program
use strict;
BEGIN {
$ENV{'LANG'} = "en_US";
$ENV{'PATH'} = "/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/joshim/bin";
$ENV{'LD_LIBRARY_PATH'} = "/usr/local:/usr/local/lib:/usr/lib";
$ENV{'ODBCHOME'} = "/usr/local";
$ENV{'ODBCINI'} = "/usr/local/etc/odbc.ini";
};
use CGI;
use DBI;
#use DBI::W32ODBC;
#use DBI:

DBC;
#use DBD:

DBC;
use TeamSite::Config;
#$ENV{'PATH'} = " /usr/local/openlink/bin:/usr/bin";
# Get Home and mount
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
(my $iwmount=TeamSite::Config::iwgetmount()) =~ tr|\\|/|;
#Turn buffering off.
#$| = 1;
my $username = 'username';
my $password = 'password';
my $sql_dbh = DBI->connect( "DBI

DBC:MSSQLTestServer",$username,$password ) or die $DBI::errstr;
my $sql = "select dbFName,dbLName,contactId from tblContacts";
# Prepare the statement.
my $sql_sth = $sql_dbh->prepare($sql)
or die "Can't prepare statement: $DBI::errstr";
# Execute the statement.
$sql_sth->execute();
#Generate Option objects for cities/locations in that region.
my $sql_row;
print "\n";
while ( my
@sql_row = $sql_sth->fetchrow_array )
{
print " \n";
}
print "\n";
$sql_dbh->disconnect;
exit;
Here is my odbc.ini entry ,
[MSSQLTestServer]
Driver = FreeTDS
Description = SQL database
Trace = No
Server = *.*.*.*
Port = 1433
Database = ***_Teamsite
I get all the values properly when running the IPL through command line.
But when I run the same via DCT, I get this,
DBI connect('MSSQLTestServer','< username >',...) failed: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (SQL-08001) at /Interwoven/TeamSite/httpd/iw-bin/connectToDb.ipl line 40
I have seen similar posts like this but they all talk about setting the env variables properly which I am doin in IPL.
Please comment.
thx in adv.