LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-15-2009, 02:54 PM   #1
domiflichi
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Rep: Reputation: 0
Problem with FreeTDS, connecting to MS SQL Server 2000


Hello,

I successfully (I think) installed and configured FreeTDS using instructions found at http://members.cox.net/midian/howto/phpMSSQL.htm, www.freetds.org, and http://www.unixodbc.org/.

I have CentOS 4.7, and downloaded/installed freetds 0.82. I'm trying to connect to a MS SQL Sever 2000 machine (running Windows 2000 Server) via ODBC. I can connect to it using tsql, but it fails when trying to use isql, it fails.
My isql command line:
Code:
isql -v MSSQLServer myuser mypass
I get:
Code:
[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
[ISQL]ERROR: Could not SQLConnect
Let me know and I can provide other info...I am fairly inexperienced in Linux however.
 
Old 06-17-2009, 10:56 AM   #2
domiflichi
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Well, I've gotten a little more information.
It seems that I'm missing a couple files in my /usr/lib directory - I don't have libtdsodbc.so.0 and libtdsodbc.so.0.0.0. I found this out by searching the net further, and installing freeTDS on my extra machine that has CentOS 5.3 on it. I was able to install freeTDS via yum on this way, so that is different. This CentOS 5.3 has these files on it, and when I configured an ODBC driver, and dsn, I can connect to my MS SQL Server successfully.
So I'm not sure what to do next to get my other machine to work though. I tried to connect again this morning, and of course it failed, but here's the sql.log contents:

Code:
[ODBC][31475][SQLFreeHandle.c][268]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x8ea2130
[ODBC][31475][SQLFreeHandle.c][317]
                Exit:[SQL_SUCCESS]
[ODBC][31475][SQLFreeHandle.c][203]
                Entry:
                        Handle Type = 1
                        Input Handle = 0x8ea1b58
[ODBC][31483][__handles.c][444]
                Exit:[SQL_SUCCESS]
                        Environment = 0x9290b58
[ODBC][31483][SQLAllocHandle.c][345]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x9290b58
[ODBC][31483][SQLAllocHandle.c][463]
                Exit:[SQL_SUCCESS]
                        Output Handle = 0x9291130
[ODBC][31483][SQLConnect.c][3549]
                Entry:
                        Connection = 0x9291130
                        Server Name = [MSSQLServer][length = 11 (SQL_NTS)]
                        User Name = [jamie][length = 5 (SQL_NTS)]
                        Authentication = [******][length = 6 (SQL_NTS)]
                UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 'UCS-2LE'

[ODBC][31483][SQLConnect.c][1249]Error: IM004
[ODBC][31483][SQLError.c][424]
                Entry:
                        Connection = 0x9291130
                        SQLState = 0xbfff1770
                        Native = 0xbfff1768
                        Message Text = 0xbfff1780
                        Buffer Length = 500
                        Text Len Ptr = 0xbfff176e
[ODBC][31483][SQLError.c][461]
                Exit:[SQL_SUCCESS]
                        SQLState = IM004
                        Native = 0xbfff1768 -> 0
                        Message Text = [[unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed]
[ODBC][31483][SQLError.c][424]
                Entry:
                        Connection = 0x9291130
                        SQLState = 0xbfff1770
                        Native = 0xbfff1768
                        Message Text = 0xbfff1780
                        Buffer Length = 500
                        Text Len Ptr = 0xbfff176e
[ODBC][31483][SQLError.c][461]
                Exit:[SQL_NO_DATA]
[ODBC][31483][SQLError.c][504]
                Entry:
                        Environment = 0x9290b58
                        SQLState = 0xbfff1770
                        Native = 0xbfff1768
                        Message Text = 0xbfff1780
                        Buffer Length = 500
                        Text Len Ptr = 0xbfff176e
[ODBC][31483][SQLError.c][541]
                Exit:[SQL_NO_DATA]
[ODBC][31483][SQLFreeHandle.c][268]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x9291130
[ODBC][31483][SQLFreeHandle.c][317]
                Exit:[SQL_SUCCESS]
[ODBC][31483][SQLFreeHandle.c][203]
                Entry:
                        Handle Type = 1
                        Input Handle = 0x9290b58
Thanks.
 
Old 06-23-2009, 09:14 AM   #3
domiflichi
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Here's another update.

I copied over the 2 missing files (libtdsodbc) from the newer CentOS 5.3 machine to the one that I cannot get to work. Then when I ran isql to try to connect to the MS SQL Server, I get the following error:

Code:
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib/libtdsodbc.so.0' : /usr/lib/libtdsodbc.so.0: requires glibc 2.5 or later dynamic linker
[ISQL]ERROR: Could not SQLConnect
Seeing that, I then ran:
Code:
rpm -qa | grep glibc
and the output was:

Code:
glibc-headers-2.3.4-2.41
glibc-2.3.4-2.41
glibc-kernheaders-2.4-9.1.103.EL
glibc-devel-2.3.4-2.41
glibc-common-2.3.4-2.41
So then I ran 'yum update glibc' to see if I could update these files, and got the following:

Code:
=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
 glibc                   i386       2.3.4-2.41.el4_7.1  update            4.3 M
Updating for dependencies:
 glibc-common            i386       2.3.4-2.41.el4_7.1  update             16 M
 glibc-devel             i386       2.3.4-2.41.el4_7.1  update            1.9 M
 glibc-headers           i386       2.3.4-2.41.el4_7.1  update            588 k

Transaction Summary
=============================================================================
Then I ran 'rpm -qa | grep glibc' on the newer system (just to verify that it had the newer glibc >= 2.5), and got the following:
Code:
glibc-2.5-34
glibc-headers-2.5-34
glibc-devel-2.5-34
glibc-common-2.5-34
So it seems that I'm pretty much 'out of luck' on this old system...is that true?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
freetds to access SQL server from linux client sailu_mvn Linux - Software 2 12-06-2005 10:19 PM
SQL Server 2000 assatron Linux - Software 4 08-19-2004 03:02 PM
freetds-perl-linux-m$sql hrc Linux - Software 0 03-08-2004 08:35 AM
Connecting to Microsoft SQL Server 2000 sput Linux - Distributions 7 08-25-2003 09:06 PM
PHP and MS SQL Server 2000 balfred Programming 0 03-24-2003 03:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration