Cannot connect to MS SQL 2005 server on alternate port. IM002/8001 error.

88 views
Skip to first unread message

ozguy

unread,
Aug 23, 2009, 10:53:42 PM8/23/09
to pyodbc
I'm trying to help a user who's been running a Python program
successfully on Windows XP to connect to a SQL Server DB on alternate
port 1435.

This error is the same as another error I've seen on other posts, and
I tried all of the configuration recommendations mentioned to no
avail.

It works fine from his XP laptop, but I cannot seem to get it working
on a CentOS 5.3 32 bit OS, with pyodbc 2.1.6, and with
unixODBC-2.2.11-7.1. The DB server is on the same subnet, and I can
telnet to the IP & port without an issue.

When I run the "isql" utility with the syntax "isql -v
192.168.195.38,1435 username password" I get the following error:
IM002][unixODBC][Driver Manager]Data source name not found, and no
default driver specified
[ISQL]ERROR: Could not SQLConnect


When I run it throught the python program with the syntax "connection
= "Driver=
{FreeTDS};SERVER=192.168.195.38,1435;Database=ANM;TrustedConnection=Yes;UID=username;PWD=password"
I get the error:

[root@pmpython user]# python stats_emails.PY
Traceback (most recent call last):
File "stats_emails.PY", line 72, in ?
db = pyodbc.connect (connection)
pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source
name not found, and no default driver specified (0)
(SQLDriverConnectW)')

Here is how the server is configured:
[root@pmpython user]# odbcinst -junixODBC 2.2.11
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
USER DATA SOURCES..: /root/.odbc.ini

/etc/odbcinit.ini looks like this:
[FreeTDS]
Description = FreeTDS driver
Driver = /usr/lib/libtdsodbc.so
Driver64 = /usr/lib/libtdsodbc.so
Setup = /usr/lib/libtdsS.so
Setup64 = /usr/lib/libtdsS.so
UsageCount = 1
CPTimeout =
CPReuse =

The modules listed are in the /usr/lib dir.

/etc/odbc.ini looks like this:
[dsn]
Description = SQL Server
Driver = FreeTDS
Address = 192.168.195.38
Port = 1435
Database = ANM
TDS Version = 8.0


Sorry if i've provided way to much info, but better to give more info
than less I guess.

I've tried tons on configuration changes as well as syntax (tried
Address = 192.168.195.38:port = 1435, etc) to no avail.

Thanks in advance for any thoughts,

Alan

ozguy

unread,
Aug 23, 2009, 10:57:25 PM8/23/09
to pyodbc
I get the same error when I try "isql -v test"

[root@pmpython user]# isql -v test
[IM002][unixODBC][Driver Manager]Data source name not found, and no
default driver specified
[ISQL]ERROR: Could not SQLConnect

So it seems to be an install, version, or compatibility error.

Alan

On Aug 23, 9:53 pm, ozguy <acho...@gmail.com> wrote:
> I'm trying to help a user who's been running a Python program
> successfully on Windows XP to connect to a SQL Server DB on alternate
> port 1435.
>
> This error is the same as another error I've seen on other posts, and
> I tried all of the configuration recommendations mentioned to no
> avail.
>
> It works fine from his XP laptop, but I cannot seem to get it working
> on a CentOS 5.3 32 bit OS, with pyodbc 2.1.6, and with
> unixODBC-2.2.11-7.1. The DB server is on the same subnet, and I can
> telnet to the IP & port without an issue.
>
> When I run the "isql" utility with the syntax "isql -v
> 192.168.195.38,1435 username password" I get the following error:
> IM002][unixODBC][Driver Manager]Data source name not found, and no
> default driver specified
> [ISQL]ERROR: Could not SQLConnect
>
> When I run it throught the python program with the syntax "connection
> = "Driver=
> {FreeTDS};SERVER=192.168.195.38,1435;Database=ANM;TrustedConnection=Yes;UID­=username;PWD=password"
Reply all
Reply to author
Forward
0 new messages