[freetds] Help on using FreeTDS.

Raja, Sunil (MLODC, Covansys - CHENNAI) SRaja at covansys.odc.ml.com
Fri May 30 03:46:28 EDT 2003


		Hi ,

			This issue was referenced earlier. However I did not
get much time to work on this. I am raising this issue again. 
			Sorry Lowden for not replying to you earlier. I was
very busy with other work.

			I am using FreeTDS v 0.6 and DBD::SYBASE v1.23.

				I am required to connect to MS Sql Server
2000 using Perl in a UNIX environment. I was successful in connecting to MS
SQL Server 7.0 using DBD::SYBASE. However it is not able to connect to the
MS SQL Server 2000 using the same DBD::SYBASE. I get the following error
when I try to connect MS SQL Server 2000 using DBD::SYBASE.
			
			Connecting to the database for using syscolumns
				DBI->connect(server=*****) failed:
OpenClient message: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER = (6)
				Message String: ct_connect(): network packet
layer: internal net library error: Net-Library operation terminated due to
disconnect
				Could not connect to ******(server name)

			The code that gave the above error is:

				writeToLog("Connecting to the database for
using syscolumns\n");
				if(($db =
DBI->connect("dbi:Sybase:server=$server",$user,$pwd))=="false")
				{
				        writeToLog("Could not connect to
$server.\n");
				        email("Could not connect to
$server");
				        exit 1;
				}
				writeToLog("Connected and using
database\n");
				$db->do("use $database");
				writeToLog("Connected to dB\n");
				my $stmt = "select AdminNo from Trades_Feed
where Feed_ID = 15857";
				my $sth=$db->prepare($stmt);
				if($sth->execute() == "undef")
				{
				        writeToLog("Sorry could not
execute\n$DBI::errstr\n");
				        $db->disconnect();
				        exit(1);
				}
			

				I perused thrrough the net and found that
the problem could be that SQL Server 2000 and SQL Server 7.0 use different
levels of TDS protocol and it is not possible to connect to SQL Server 2000
through the DBD::SYBASE.  I changed the tdsLevel in the DBI->connect to the
previous version namely CS_TDS_42 but to no avail. Freetds was proposed to
be a good solution here.

			Since I am a newbie to FreeTDS, I went through
freetds.org and with the information I could gather from there, I changed
the environmental variable SYBASE and the LD_LIBRARY_PATH.

			setenv SYBASE /apps/sun5/freetds (that is where it
points)
			setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:$SYBASE/lib

			and I get this error when I run the script without
changing any code and still using DBD::SYBASE

				Out of memory during ridiculously large
request at /apps/sun5/perl5.6/lib/site_perl/5.6.0/sun4-solaris/DBD/Sybase.pm
line 73

				Am I supposed to recompile the DBD::SYBASE
or something like that, because the freetds.org explains something like that
and it also uses a command called "configure" which I am not able to find
anywhere.
				
			Can you please help me in using freetds. 

	Thanks so much in advance for your time,

	Regards,

	Sunil Raja



More information about the FreeTDS mailing list