[ISQL]ERROR: Could not SQLConnect

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ISQL]ERROR: Could not SQLConnect

ysri
On Redhat Enterprise Linux 5.9 with unixODBC 2.3.0, on isql I get error '[ISQL]ERROR: Could not SQLConnect'
The SQL server accepts remote connections and I can ping the SQL server box from this linux machine.

[sri@linuxboxA ~]$ ls -l /opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
-rwxr-xr-x 1 root root 1321480 Jan 26 23:30 /opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0

[sri@linuxboxA ~]$ odbcinst --version
unixODBC 2.3.0

[sri@linuxboxA etc]$ cat odbcinst.ini
[ODBC]
Trace=Yes
TraceFile=/tmp/trace.log

[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1


[sri@linuxboxA etc]$ cat odbc.ini
[ODBC Data Sources]
my_mssqlserver=MicroStrategy ODBC Driver for my_mssqlserver

[my_mssqlserver]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=SQL Server Native Client 11.0
Address=SQLSERVERA,1433
Database=DB_MNO
Trace=Yes
QuotedId=Yes
AnsiNPW=Yes
IANAAppCodePage=106

[sri@linuxboxA etc]$ isql my_mssqlserver <userid> <password> -v
[S1T00][unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired
[08001][unixODBC][Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
[08001][unixODBC][Microsoft][SQL Server Native Client 11.0]TCP Provider: Error code 0x2726
[ISQL]ERROR: Could not SQLConnect


The trace file is:

[sri@linuxboxA etc]$ cat /tmp/trace.log
[ODBC][23640][1391013791.314904][__handles.c][459]
                Exit:[SQL_SUCCESS]
                        Environment = 0x14c88750
[ODBC][23640][1391013791.314955][SQLAllocHandle.c][375]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x14c88750
[ODBC][23640][1391013791.314980][SQLAllocHandle.c][493]
                Exit:[SQL_SUCCESS]
                        Output Handle = 0x14c89080
[ODBC][23640][1391013791.315012][SQLConnect.c][3654]
                Entry:
                        Connection = 0x14c89080
                        Server Name = [SQLSERVERA][length = 10 (SQL_NTS)]
                        User Name = [<userid>][length = 6 (SQL_NTS)]
                        Authentication = [*******][length = 7 (SQL_NTS)]
                UNICODE Using encoding ASCII 'UTF8' and UNICODE 'UTF16LE'

                DIAG [08001] [Microsoft][SQL Server Native Client 11.0]TCP Provider: Error code 0x2726

                DIAG [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

                DIAG [S1T00] [Microsoft][SQL Server Native Client 11.0]Login timeout expired

[ODBC][23640][1391013806.343499][SQLConnect.c][4172]
                Exit:[SQL_ERROR]
[ODBC][23640][1391013806.343535][SQLError.c][434]
                Entry:
                        Connection = 0x14c89080
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe
[ODBC][23640][1391013806.343573][SQLError.c][471]
                Exit:[SQL_SUCCESS]
                        SQLState = S1T00
                        Native = 0x7fffac62def8 -> 0
                        Message Text = [[unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired]
[ODBC][23640][1391013806.343618][SQLError.c][434]
                Entry:
                        Connection = 0x14c89080
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe
[ODBC][23640][1391013806.343659][SQLError.c][471]
                Exit:[SQL_SUCCESS]
                        SQLState = 08001
                        Native = 0x7fffac62def8 -> 10022
                        Message Text = [[unixODBC][Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing]
[ODBC][23640][1391013806.343710][SQLError.c][434]
                Entry:
                        Connection = 0x14c89080
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe
[ODBC][23640][1391013806.343752][SQLError.c][471]
                Exit:[SQL_SUCCESS]
                        SQLState = 08001
                        Native = 0x7fffac62def8 -> 10022
                        Message Text = [[unixODBC][Microsoft][SQL Server Native Client 11.0]TCP Provider: Error code 0x2726]
[ODBC][23640][1391013806.343790][SQLError.c][434]
                Entry:
                        Connection = 0x14c89080
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe
[ODBC][23640][1391013806.343824][SQLError.c][471]
                Exit:[SQL_NO_DATA]
[ODBC][23640][1391013806.343850][SQLError.c][514]
                Entry:
                        Environment = 0x14c88750
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe
[ODBC][23640][1391013806.343871][SQLError.c][551]
                Exit:[SQL_NO_DATA]
[ODBC][23640][1391013806.343911][SQLFreeHandle.c][286]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x14c89080
[ODBC][23640][1391013806.343944][SQLFreeHandle.c][337]
                Exit:[SQL_SUCCESS]
[ODBC][23640][1391013806.343973][SQLFreeHandle.c][219]
                Entry:
                        Handle Type = 1
                        Input Handle = 0x14c88750

Can you please help resolve the connectivity issue?
Thanks,
-srinivas y.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ISQL]ERROR: Could not SQLConnect

Anglister, Shlomo
As MS traces are extremely elaborated but provide no clues I can only offer hints:
1) Can it be a license issue? MS are usually requesting a signature on a license agreement before running, the license file should reside exactly where they define.
2) What kind of authentication are you using? SQL or Windows?
    If it is windows, sometimes there is a domain used so your user name will be <domain name>\<user name>
    There is also the "Trusted_Connection=True" which not to be specified as MS has different connection security protocols.
3) Do you have special characters in your password? Sometimes those are interpreted in Linux shell or wrongly interpreted  on the SQL server (especially '%' character)


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of ysri
Sent: Wednesday, January 29, 2014 21:23
To: [hidden email]
Subject: [unixODBC-support] [ISQL]ERROR: Could not SQLConnect

On Redhat Enterprise Linux 5.9 with unixODBC 2.3.0, on isql I get error
'[ISQL]ERROR: Could not SQLConnect'
The SQL server accepts remote connections and I can ping the SQL server box from this linux machine.

[sri@linuxboxA ~]$ ls -l
/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
-rwxr-xr-x 1 root root 1321480 Jan 26 23:30
/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0

[sri@linuxboxA ~]$ odbcinst --version
unixODBC 2.3.0

[sri@linuxboxA etc]$ cat odbcinst.ini
[ODBC]
Trace=Yes
TraceFile=/tmp/trace.log

[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1


[sri@linuxboxA etc]$ cat odbc.ini
[ODBC Data Sources]
my_mssqlserver=MicroStrategy ODBC Driver for my_mssqlserver

[my_mssqlserver]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux Driver=SQL Server Native Client 11.0
Address=SQLSERVERA,1433
Database=DB_MNO
Trace=Yes
QuotedId=Yes
AnsiNPW=Yes
IANAAppCodePage=106

[sri@linuxboxA etc]$ isql my_mssqlserver <userid> <password> -v [S1T00][unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired [08001][unixODBC][Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
[08001][unixODBC][Microsoft][SQL Server Native Client 11.0]TCP Provider:
Error code 0x2726
[ISQL]ERROR: Could not SQLConnect


The trace file is:

[sri@linuxboxA etc]$ cat /tmp/trace.log
[ODBC][23640][1391013791.314904][__handles.c][459]
                Exit:[SQL_SUCCESS]
                        Environment = 0x14c88750 [ODBC][23640][1391013791.314955][SQLAllocHandle.c][375]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x14c88750 [ODBC][23640][1391013791.314980][SQLAllocHandle.c][493]
                Exit:[SQL_SUCCESS]
                        Output Handle = 0x14c89080 [ODBC][23640][1391013791.315012][SQLConnect.c][3654]
                Entry:
                        Connection = 0x14c89080
                        Server Name = [SQLSERVERA][length = 10 (SQL_NTS)]
                        User Name = [<userid>][length = 6 (SQL_NTS)]
                        Authentication = [*******][length = 7 (SQL_NTS)]
                UNICODE Using encoding ASCII 'UTF8' and UNICODE 'UTF16LE'

                DIAG [08001] [Microsoft][SQL Server Native Client 11.0]TCP
Provider: Error code 0x2726

                DIAG [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

                DIAG [S1T00] [Microsoft][SQL Server Native Client 11.0]Login timeout expired

[ODBC][23640][1391013806.343499][SQLConnect.c][4172]
                Exit:[SQL_ERROR]
[ODBC][23640][1391013806.343535][SQLError.c][434]
                Entry:
                        Connection = 0x14c89080
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe [ODBC][23640][1391013806.343573][SQLError.c][471]
                Exit:[SQL_SUCCESS]
                        SQLState = S1T00
                        Native = 0x7fffac62def8 -> 0
                        Message Text = [[unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired] [ODBC][23640][1391013806.343618][SQLError.c][434]
                Entry:
                        Connection = 0x14c89080
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe [ODBC][23640][1391013806.343659][SQLError.c][471]
                Exit:[SQL_SUCCESS]
                        SQLState = 08001
                        Native = 0x7fffac62def8 -> 10022
                        Message Text = [[unixODBC][Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing] [ODBC][23640][1391013806.343710][SQLError.c][434]
                Entry:
                        Connection = 0x14c89080
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe [ODBC][23640][1391013806.343752][SQLError.c][471]
                Exit:[SQL_SUCCESS]
                        SQLState = 08001
                        Native = 0x7fffac62def8 -> 10022
                        Message Text = [[unixODBC][Microsoft][SQL Server Native Client 11.0]TCP Provider: Error code 0x2726] [ODBC][23640][1391013806.343790][SQLError.c][434]
                Entry:
                        Connection = 0x14c89080
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe [ODBC][23640][1391013806.343824][SQLError.c][471]
                Exit:[SQL_NO_DATA]
[ODBC][23640][1391013806.343850][SQLError.c][514]
                Entry:
                        Environment = 0x14c88750
                        SQLState = 0x7fffac62dee0
                        Native = 0x7fffac62def8
                        Message Text = 0x7fffac62dce0
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffac62defe [ODBC][23640][1391013806.343871][SQLError.c][551]
                Exit:[SQL_NO_DATA]
[ODBC][23640][1391013806.343911][SQLFreeHandle.c][286]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x14c89080 [ODBC][23640][1391013806.343944][SQLFreeHandle.c][337]
                Exit:[SQL_SUCCESS]
[ODBC][23640][1391013806.343973][SQLFreeHandle.c][219]
                Entry:
                        Handle Type = 1
                        Input Handle = 0x14c88750

Can you please help resolve the connectivity issue?
Thanks,
-srinivas y.



--
View this message in context: http://unixodbc.13851.n7.nabble.com/ISQL-ERROR-Could-not-SQLConnect-tp3970.html
Sent from the Support mailing list archive at Nabble.com.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ISQL]ERROR: Could not SQLConnect

Nick Gorham-2
On 30/01/14 07:52, Anglister, Shlomo wrote:

> As MS traces are extremely elaborated but provide no clues I can only offer hints:
> 1) Can it be a license issue? MS are usually requesting a signature on a license agreement before running, the license file should reside exactly where they define.
> 2) What kind of authentication are you using? SQL or Windows?
>      If it is windows, sometimes there is a domain used so your user name will be <domain name>\<user name>
>      There is also the "Trusted_Connection=True" which not to be specified as MS has different connection security protocols.
> 3) Do you have special characters in your password? Sometimes those are interpreted in Linux shell or wrongly interpreted  on the SQL server (especially '%' character)
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of ysri
> Sent: Wednesday, January 29, 2014 21:23
> To: [hidden email]
> Subject: [unixODBC-support] [ISQL]ERROR: Could not SQLConnect

The ini file has a DSN of

my_mssqlserver

By the trace shows you connecting to

SQLSERVERA


Try

isql -v my_mssqlserver user pass

--
Nick

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ISQL]ERROR: Could not SQLConnect

ysri
In reply to this post by Anglister, Shlomo
Hi,
1) I will check on the license issue
2) SQL authentication
3) '$' is used in the password

I used the correct sql server name in my odbc.ini at both places, for security reasons I renamed before posting here and got it wrong !

Thanks guys,
-sri
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ISQL]ERROR: Could not SQLConnect

ysri
In reply to this post by ysri
I found the issue, in the odbc.ini the attribute 'Address' should instead be 'Server' and then it worked !
Thanks
Loading...