Solved

How to connect to SQL server without using ODBC?

Posted on 2016-09-14
17
91 Views
Last Modified: 2016-09-16
Hi,

I have an application running in Linux server which use ODBC to connect on Windows 2008 SQL server but I got an SSL error.

To eliminate any possibilty that error is from ODBC is it possible to test the connection without ODBC? Sorry I'm not too familiar with SQL that's why I need your help.

Thanks
0
Comment
Question by:SAM2009
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 3
  • +1
17 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41799150
I don't know why you would get an SSL error.  What programming language are you using?
0
 
LVL 7

Assisted Solution

by:D Patel
D Patel earned 200 total points
ID: 41799151
Use the below connection string:

@db->setDatabaseName("Driver={SQL Server Native Client 11.0};Server=<ip/host>;Database=<database>;Uid=<userid>;Pwd=<password>;")@
0
 
LVL 1

Author Comment

by:SAM2009
ID: 41799154
Honestly which program language it's used I don't know. The only thing that interest me for now is how to test the connection without ODBC?

Thanks Dhara but beside that cmd is there any tool that I can use to test myself on Windows?
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 7

Expert Comment

by:D Patel
ID: 41799156
It's ASP.NET
0
 
LVL 1

Author Comment

by:SAM2009
ID: 41799159
When it uses SSL to connect on SQL server does it mean that SSL certificate should be installed on SQL server?
0
 
LVL 7

Expert Comment

by:D Patel
ID: 41799164
In C++ You can connect using ODBC without a DSN using SQLDriverConnect. Specify the name of an installed driver in the connection string. A SQL Server Native client 11 example:

Driver={SQL Server Native Client 11.0};Server=SqlHostName;Database=SomeSqlDatabase;UID=YourUserName;PWD=YourPassword

Code snippet:

retcode = SQLDriverConnect(hdbc
    , NULL
    , (SQLCHAR*)InConnectionString
    , (SQLSMALLINT)sizeof(InConnectionString)
    , (SQLCHAR*)OutConnectionString
    , (SQLSMALLINT)sizeof(OutConnectionString)
    , (SQLSMALLINT*)StringLength2Ptr
    , (SQLUSMALLINT)DriverCompletion
    );
0
 
LVL 78

Expert Comment

by:arnold
ID: 41799173
If encryption of the connection required, you can set the OpenSSL.conf not to validate the certificate which is likely what the issue is the certificate presented in the one ton can not be validated no thus the connection drops.

To test you have to have info on what you are using. Likely freetds.

The example provided is for a Windows system.

Adding the SQL server cert is trusted would eliminate the error......

Double check whether your setup is actually using web based XML queries to the DB.
0
 
LVL 1

Author Comment

by:SAM2009
ID: 41799176
Correct me if I'm wrong but to be able to use an SSL connection on SQL server a certificate is required right on SQL server? Because I don't see any certificate.
0
 
LVL 78

Expert Comment

by:arnold
ID: 41799204
Look within the data for, there should certs there. Check the TCP/ip in the SQL server configuration dealing with encryption...

Did it work before and only stopped recently or is it the first setup...
0
 
LVL 1

Author Comment

by:SAM2009
ID: 41799568
When you said look withing the data, what you meant?
0
 
LVL 78

Expert Comment

by:arnold
ID: 41799766
Your existing application, how is it interacting/connecting to the DB.
On linux, what programing language is being used is this a PHP page, python, tcl, etc.

When do you see an SSL error and from what application/interface?
0
 
LVL 1

Author Comment

by:SAM2009
ID: 41800321
It's a third party application.

But what I really need is that someone could confirm if ssl connection on sql server needs a cert installed on that server.

Could you just confirm that please?
0
 
LVL 78

Expert Comment

by:arnold
ID: 41800346
There is no way to confirm that other than looking on the SQL server to see whether it requires an encrypted connection.
Where and when do you see the SSL connection error?
The third party application might as part of its process have to validate the licensing meaning it has to connect to the vendor's secure site and that is where you are getting the SSL connection error, i.e. the URL for license validation has issues.
0
 
LVL 78

Accepted Solution

by:
arnold earned 300 total points
ID: 41800349
Here is the technet article that you can follow to check whether your SQL server connection requires encryption...

https://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx

Sql2008R2
0
 
LVL 1

Author Comment

by:SAM2009
ID: 41800908
SSL connection port to Windows SQL server is it tcp/1433 or this port is used also for non ssl connection?
0
 
LVL 78

Expert Comment

by:arnold
ID: 41800945
I think it will remain 1433 the client and server negotiate if to encrypt or not. Or server can require encryption.
0
 
LVL 1

Author Closing Comment

by:SAM2009
ID: 41802453
Thanks for your hep!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question