HI,
I am using TeamSite 6.5 on Windows 2000 SP4.
I have written the following code in perl to connect to a db:
[HTML]
#!/usr/bin/perl -w
use CGI("standard");
use DBI;
use DBD:

DBC;
my $dbh = DBI-> connect('dbi

DBC:sad','user','password');
my $sth = $dbh->prepare( q{ SELECT * FROM
State } );
my $rc = $sth->execute() ;
my $name = "";
print "Field names: \n";
print "@{ $sth->{NAME} }\n";
[/HTML]
This piece of code is working. Here sad is the DSN I have created.
I am now trying to do the same thing through a TPL but it is not connecting to the database. The code I have written is :
[HTML]
use CGI("standard");
use DBI;
use DBD:

DBC;
my $dbh = DBI-> connect('dbi

DBC:sad','user,'password');
my $sth = $dbh->prepare( q{ SELECT * FROM State } ) ;
my $rc = $sth->execute();
my $name = "";
my $job = "";
iwpt_output( "Field names: \n");
iwpt_output( "@{ $sth->{NAME} }\n");
[/HTML]
On doing this I am getting the following error on trying to preview the TPL
<
Preview And Generate Error:
Could not process template: Y:\abc\main\internal\intranet\dev\WORKAREA\a_wa\templatedata\fragment\index\presentation\index.tpl
:\abc\main\internal\intranet\dev\WORKAREA\a_wa\templatedata\fragment\index\presentation\index.tpl
>
Also I have tried doing the following in the TPL:
[HTML]
data_source = "dbi

DBC:sad1"
user_name = 'wu_dev'
password = 'wuintranet'>
[/HTML]
On this I am getting the following error:
iw_sql_open: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1)
:\abc\main\internal\intranet\dev\WORKAREA\a_wa\templatedata\fragment\index\presentation\index.tpl
Can somebody please help me these problems.