Skip to Content.
Sympa Menu

freetds - [freetds] Sybase ASE 15.0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Federico Alves" <sales AT minixel.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Sybase ASE 15.0
  • Date: Mon, 23 Feb 2009 20:29:08 -0500

I need to connect ODBC-Freetds to a Sybase ASE 15 server. What do have to
use in terms of tds version? Is there any information or example that I may
use? The server is located in the same box at port 5000. But I also need to
be keep talking to SQL Server on a different connection, so the same
binaries need to be used.
Federico

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
freetds-request AT lists.ibiblio.org
Sent: Monday, February 23, 2009 1:21 PM
To: freetds AT lists.ibiblio.org
Subject: FreeTDS Digest, Vol 73, Issue 30

Send FreeTDS mailing list submissions to
freetds AT lists.ibiblio.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.ibiblio.org/mailman/listinfo/freetds
or, via email, send a message with subject or body 'help' to
freetds-request AT lists.ibiblio.org

You can reach the person managing the list at
freetds-owner AT lists.ibiblio.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of FreeTDS digest..."


Today's Topics:

1. Re: Regarding MSSQL connection (James K. Lowden)
2. Re: Regarding MSSQL connection (Gopalakrishnan A.N)
3. ODBC SQLSetDescRec fix (Amir Shamsuddin)
4. Re: ODBC SQLSetDescRec fix (Frediano Ziglio)
5. freetds with DBD::Sybase using Apache (Gaurav Nangia)
6. Requesting Help with ODBC and DSN (Computos)


----------------------------------------------------------------------

Message: 1
Date: Mon, 23 Feb 2009 07:57:56 -0500
From: "James K. Lowden" <jklowden AT freetds.org>
Subject: Re: [freetds] Regarding MSSQL connection
To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
Message-ID: <20090223075756.70c01092.jklowden AT freetds.org>
Content-Type: text/plain; charset=US-ASCII

Gopalakrishnan A.N wrote:
> I am trying to connect MS SQL server, but it gets fails with SQL connect
> error. ... I am attaching my
> freetds.conf, odbc.ini and odbcinst.ini

> Servername = 172.20.182.10

should be

Servername = egServer70

The ODBC Servername connection property refers to a name in freetds.conf.


(The osql script is intended to report mistakes like this.)

HTH.

--jkl



------------------------------

Message: 2
Date: Mon, 23 Feb 2009 18:33:09 +0530
From: "Gopalakrishnan A.N" <saigop AT gmail.com>
Subject: Re: [freetds] Regarding MSSQL connection
To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
Message-ID:
<2ea4d47e0902230503k27719c30ue2aa7d71a77e475a AT mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Thanks James, Let me check and will revert back.

On Mon, Feb 23, 2009 at 6:27 PM, James K. Lowden
<jklowden AT freetds.org>wrote:

> Gopalakrishnan A.N wrote:
> > I am trying to connect MS SQL server, but it gets fails with SQL connect
> > error. ... I am attaching my
> > freetds.conf, odbc.ini and odbcinst.ini
>
> > Servername = 172.20.182.10
>
> should be
>
> Servername = egServer70
>
> The ODBC Servername connection property refers to a name in freetds.conf.
>
>
> (The osql script is intended to report mistakes like this.)
>
> HTH.
>
> --jkl
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



--
Thank you with regards,
Gopal,


------------------------------

Message: 3
Date: Mon, 23 Feb 2009 15:24:20 +0000
From: Amir Shamsuddin <amirs2+freetds AT gmail.com>
Subject: [freetds] ODBC SQLSetDescRec fix
To: freetds AT lists.ibiblio.org
Message-ID:
<d7b0c8250902230724p68eba1edhde2fd2b7237e446b AT mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,
I'm using freeTDS with sqlapi and using the odbc interface as recommended by
sqlapi to connect to a MSSQL server.

My program was crashing, so I tracked the issue back to a call made from
sqlapi to the freeTDS SQLSetDescRec method. It seems that sqlapi and freetds
disagree over the meaning of the nRecordNumber parameter, with sqlapi
starting indexing at 1 and freetds starting at 0, with the end result that
memory past the end of desc->records was being written to (and thus causing
the crash).

Looking at the MSDN ODBC reference
http://msdn.microsoft.com/en-us/library/ms714675(VS.85).aspx it looks to me
that nRecordNumber should start indexing at 1, with an index of 0 being
reserved for the 'bookmark record', though I'm not sure what the bookmark
record is....

so I modified freeTDS to adjust the offset before accessing the
desc->records array (very simple patch attached) and this fixed my problem.

hopefully this is a real bug report / patch and is helpful to you,

regards,

Amir

PS I'm using freeTDS version 0.64, but the patch is against current CVS
which still appears to have the same problem

--
Amir Shamsuddin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setDescRec.patch
Type: application/octet-stream
Size: 1222 bytes
Desc: not available
Url :
https://lists.ibiblio.org/sympa/arc/freetds/attachments/20090223/574dd65d/att
achment-0001.obj

------------------------------

Message: 4
Date: Mon, 23 Feb 2009 17:17:39 +0100
From: Frediano Ziglio <freddy77 AT gmail.com>
Subject: Re: [freetds] ODBC SQLSetDescRec fix
To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
Message-ID:
<aa1b71110902230817g13fcfce5h59b52f74cd5147db AT mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

2009/2/23 Amir Shamsuddin <amirs2+freetds AT gmail.com>:
> Hi,
> I'm using freeTDS with sqlapi and using the odbc interface as recommended
by
> sqlapi to connect to a MSSQL server.
>
> My program was crashing, so I tracked the issue back to a call made from
> sqlapi to the freeTDS SQLSetDescRec method. It seems that sqlapi and
freetds
> disagree over the meaning of the nRecordNumber parameter, with sqlapi
> starting indexing at 1 and freetds starting at 0, with the end result that
> memory past the end of desc->records was being written to (and thus
causing
> the crash).
>
> Looking at the MSDN ODBC reference
> http://msdn.microsoft.com/en-us/library/ms714675(VS.85).aspx it looks to
me
> that nRecordNumber should start indexing at 1, with an index of 0 being
> reserved for the 'bookmark record', though I'm not sure what the bookmark
> record is....
>
> so I modified freeTDS to adjust the offset before accessing the
> desc->records array (very simple patch attached) and this fixed my
problem.
>
> hopefully this is a real bug report / patch and is helpful to you,
>
> regards,
>
> Amir
>
> PS I'm using freeTDS version 0.64, but the patch is against current CVS
> which still appears to have the same problem
>

Thanks, patch is ok.

Applied to 0.64, 0.82 and CVS HEAD. You can find post release patch at
http://freetds.sourceforge.net/ (updated snapshot will be generated
this nigth).

Regards
Frediano


------------------------------

Message: 5
Date: Mon, 23 Feb 2009 11:31:06 -0500
From: Gaurav Nangia <gnangia AT dtcc.com>
Subject: [freetds] freetds with DBD::Sybase using Apache
To: FreeTDS AT lists.ibiblio.org
Message-ID:
<OFA2D2F836.26D5B2E8-ON85257566.005A532F-85257566.005ABABB AT dtcc.com>
Content-Type: text/plain; charset="US-ASCII"

I am using the DBD::Sybase module (v1.07) with freetds 0.63 in a cgi
script that is launched from an Apache webserver. The cgi-script works
fine from the command line where it is able to use the DBD module to
connect to the backend database and provide the output from the DB.
However, when I run it from the Apache webserver, it complains with the
following errors -

[Mon Feb 23 11:22:09 2009] [error] [client 172.22.88.176]
install_driver(Sybase) failed: Can't load
'/usr/local/lib/perl5/site_perl/5.8.3/sun4-solaris/auto/DBD/Sybase/Sybase.so
'
for module DBD::Sybase: ld.so.1: /usr/local/bin/perl: fatal:
libgcc_s.so.1: open failed: No such file or directory at
/usr/local/lib/perl5/5.8.3/sun4-solaris/DynaLoader.pm line 229.
[Mon Feb 23 11:22:09 2009] [error] [client 172.22.88.176] at (eval 3)
line 3
[Mon Feb 23 11:22:09 2009] [error] [client 172.22.88.176] Compilation
failed in require at (eval 3) line 3.
[Mon Feb 23 11:22:09 2009] [error] [client 172.22.88.176] Perhaps a
required shared library or dll isn't installed where expected
[Mon Feb 23 11:22:09 2009] [error] [client 172.22.88.176] at
/opt/apache/cgi-bin/dmz_summary.cgi line 25
[Mon Feb 23 11:22:09 2009] [error] [client 172.22.88.176] Premature end of
script headers: dmz_summary.cgi

Here is a copy of the script -
!/usr/local/bin/perl


BEGIN
{
$ENV{'SYBASE'} = "/usr/local/freetds";
$ENV{'LD_LIBRARY_PATH'} =
"/usr/lib:/usr/local/lib:/usr/local/freetds/lib:/opt1/netcool/platform/solar
is2/lib";
$ENV{'SHLIB_PATH'} =
"/usr/lib:/usr/local/lib:/usr/local/freetds/lib:/opt1/netcool/platform/solar
is2/lib";
$ENV{'LIBPATH'} ="/opt1/netcool/platform/solaris2/lib";
}

use DBI;
use strict;
use warnings;

my $log = "/tmp/gntest";
open(LOG, "> $log");
my $objectserver = "DEVPNCOMS";
my $user = "xxxx";
my $password = "yyyy";
my $omni_dbh = DBI->connect("dbi:Sybase:server=$objectserver", "$user",
"$password", {PrintError => 0});
if (!$omni_dbh)
{
#exit 1;
}

print LOG "Connected to primary objectserver: $objectserver\n";
my $sth = $omni_dbh->prepare("select count(Node) from alerts.status");
my $total = 0;

if($sth->execute)
{
while (my $res = $sth->fetchrow_arrayref)
{
$total = $res->[0];
}
}
print LOG "Total is $total\n";
close(LOG);
$omni_dbh->disconnect();

print "Content-type: text/html\n\n";

print <<__HTML__;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>DMZ Status</title>
</head>
<body>
__HTML__

print "<p>Total: $total</p>";
print <<__HTML__;
</body>
</html>
__HTML__
======================================
When I run from command line, here is what I get -

tmebatp4:root:/opt/apache/cgi-bin>./dmz_summary.cgi
Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>DMZ Status</title>
</head>
<body>
<p>Total: 458</p></body>
</html>
=============================
Any help would be appreciated.



Regards,
Gaurav Nangia
The Depository Trust & Clearing Corporation
Management and Network Security
(212) 855 - 2317


-----------------------------------------
________________________________________________________
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses. The company
accepts no liability for any damage caused by any virus transmitted
by this email.

------------------------------

Message: 6
Date: Mon, 23 Feb 2009 15:15:50 -0200
From: Computos <computos AT valmotors.com.ar>
Subject: [freetds] Requesting Help with ODBC and DSN
To: freetds AT lists.ibiblio.org
Message-ID: <1235409350.6296.33.camel@Ventas01-SF-L>
Content-Type: text/plain

Hello everybody from Argentina!
I will try to explain to you my problem with DSN and ODBC under Ubuntu
I have a proprietary application running under windows 2000 sp4 and the
latest sql server application.
My problem is that I've installed Ubuntu in a workstation and it's hard
to me to configure the System DSN. Maybe I am wrong setting up proper
driver for ODBC in the workstation or I don't know nothing. Anyway I
request from you a proper odbc.ini and odbcinst.ini files configuration.
if it is possible.
For best understand i send attached a configuration of my DSN in
windows, then you can teach me how replace it in Ubuntu.
I have installed unixODBC and freeTDS in my Ubuntu Workstation.

DSN COnfiguration: ----> (in win Workstation)

* 1st Page
Name: dsnPrincipal
Description: Main Database
Server: SERVERSQL\AUTOPACK

* 2nd Page
Loggin ID: sa
Password: (no password)

* 3rd Page
x Change the dafault database ---> (Checked)
Principal

This is the most important, i guess.
Well that's all, appreciate any kind of help about this.
Sorry my English please

Regards
Alberto



------------------------------

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds


End of FreeTDS Digest, Vol 73, Issue 30
***************************************





Archive powered by MHonArc 2.6.24.

Top of Page