google-code-export / django-pyodbc

Automatically exported from code.google.com/p/django-pyodbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[ISQL]ERROR: Could not SQLConnect #128

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. test tsql [works]
2. test isql [no luck]
3. test iusql [no luck]

What is the expected output? What do you see instead?
EXPECTED
$isql -v ODBCNAME USERNAME PASSWORD
+---------------------------------------+
| Connected!    

but get:

[ISQL]ERROR: Could not SQLConnect
and 
[ISQL]ERROR: Could not SQLDriverConnect

What version of the product are you using? On what operating system?
unixODBC 2.2.14
Ubuntu12.04
MSSQL2008

Please provide any additional information below.

/odbc.log
[ODBC][14658][1375140244.455899][SQLConnect.c][3616]
                Entry:
                        Connection = 0x147c082
                        Server Name = (SQL_NTS)]
                        User Name =  (SQL_NTS)]
                        Authentication = [PW](SQL_NTS)]
                UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 'UCS-2LE'

                DIAG [42000] [FreeTDS][SQL Server]Login failed for user ''.

                DIAG [S1000] [FreeTDS][SQL Server]Unable to connect to data source

Original issue reported on code.google.com by mseme...@gmail.com on 29 Jul 2013 at 11:42

GoogleCodeExporter commented 9 years ago
Pls help...
$ isql -v ocs_cfg_db
[08004][unixODBC][ODBC Firebird Driver]File Database is not found
[ISQL]ERROR: Could not SQLConnect
$ odbcinst -q -s
[ocs_cfg_db]
$ odbcinst -q -d
[Firebird]
$ odbcinst -j
unixODBC 2.2.14
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/danateq/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

 odbc.ini 
[ocs_cfg_db]
Description     = Firebird
Driver          = Firebird
Dbname          = host/port:ocs_cfg_db
User            = sysdba
Password        = masterkey
Role            =
CharacterSet    =
ReadOnly        = No
NoWait          = No

 odbcinst.ini 
[Firebird]
Description=InterBase/Firebird ODBC Driver
Driver=/usr/lib64/libOdbcFb.so.2.1.0
Setup=/usr/lib64/libOdbcFb.so.2.1.0
FileUsage=1
CPTimeout=
CPReuse=
UsageCount=10

Original comment by wmsi...@gmail.com on 25 Sep 2013 at 6:31

GoogleCodeExporter commented 9 years ago
This took me almost a week to figure out I'll see if I can help.

/etc/freetds/freetds.conf

# Define a connection to the Microsoft SQL Server
[mssql]
        host = XXXXXXXXXXXX - This is your server name.
        port = 1433
        tds version = 8.0

/etc/odbc.ini

# Define a connection to a Microsoft SQL server
# The Description can be whatever we want it to be.
# The Driver value must match what we have defined in /etc/odbcinst.ini
# The Database name must be the name of the database this connection will 
connect to.
# The ServerName is the name we defined in /etc/freetds/freetds.conf
# The TDS_Version should match what we defined in /etc/freetds/freetds.conf
[mssql]
Description             = MSSQL Server
Driver                  = freetds
Database                = dbname #This is your Database name in MSSQL Server
Server                  = XXXXXXXXXXXX #This is your server name again
Port                    = 1433
TDS_Version             = 8.0

/etc/odbcinst.ini

# Define where to find the driver for the Free TDS connections.
[freetds]
Description     = MS SQL database access with Free TDS
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so
UsageCount      = 1

Make sure you're in the right location here.

Big thing that stands out is what's that Firebird driver?  If you're using 
MSSQL just use unixODBC and freeTDS newest versions for both will suffice.

Original comment by whoisea...@gmail.com on 11 Nov 2013 at 4:38

GoogleCodeExporter commented 9 years ago
Wonderful help.. my paths were mostly different, but finding the locations and 
pointing to them worked fine. Thanks for your week of work!

Original comment by Henry.Co...@gmail.com on 30 Jun 2014 at 7:24