SQL Server Login works with DSN for ODBC driver 11 for SQL Server but unable to connect through connection string (Classic ASP Application) - sql-server-2008

We have a Classic ASP application hosted on server Win 2008 R2, Database - SQL server 2008 R2. The application was working fine until we disabled TLS 1.0 and enabled TLS 1.2 in app server. TLS 1.2 is enabled on Database server. We have installed SSMS on app server and are able to connect to DB. Created a system DSN and tested using ODBC drivers which is only successful when tried "ODBC driver 11 for SQL Server" driver. Performed UDL test in app server and the test connection failed while using both DSN and connection string with errors "Invalid Connection String Attribute" and "Data source name not found and no default driver specified" respectively. Instead of OLEDB we have tried SQLNCLI10 which also didn't work.
Tried all the drivers and the respective connection-strings, though able to establish connection using "ODBC driver 11 for SQL Server". Hence also tried the connection strings
SQL Server Native Client
Driver={SQL Server Native Client 11.0};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
SQL Server for ODBC
DRIVER={ODBC Driver 11 for SQL Server};SERVER=test;DATABASE=test;UID=user;PWD=password
DSN
DSN=myDsn;Uid=myUsername;Pwd=;
But unable to establish connection to database. Please suggest.

This works for my SQL Server 2008 R2 classic ASP application.
Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

Related

Linking MySQL server on Sql Server 2008

In our application I have to transfer data from between a MySql Server deployed on Linux machine and a SQL Server deployed on a Windows machine, its both the ways.
We plan to do it by creating MySql as a linked server on SQL Server. I have created a DSN pointing to the Linux Server and it shows "Connection Successfull" when I "test" it.
I get the following error when I try to add the same MySql server as a linked server
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "MYSQLDNS".
OLE DB provider "MSDASQL" for linked server "MYSQLDNS" returned message "[MySQL][ODBC 5.1 Driver]Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060". (Microsoft SQL Server, Error: 7303)
The DSN I am using is a System DSN. I have tried with a User DSN too.
I can connect to the mysql instance using a MySQL Workbench. I can telnet into it too.
Our MySQL is installed on a 64 bit linux machine and the SQL Server is a 32 bit windows machine.
I was getting this error too - 64 bit ODBC version 8 driver from MySQL, using 64 bit Windows and 64 bit SQL Server. For me it was the Connection Timeout property on the linked server in SQL Server

Oracle ODBC ERROR [IM004] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV

I have installed the Oracle client 10g (release 10.2.0.1) on to a windows 2008 64bit machine.
I have set up the tnsname.ora file, checked the path (starts with path to oracle client folder) and oracle_home variables.
I have also checked the security permissions on the client folder and this has read/write for the authenticated user.
I set up an ODBC32 connection using the Oracle Oracle Driver (as opposed to the Microsoft one) and tested connection successfully.
I set the Runtime64Bit property in the project in SSIS (SQL Server 2008 R2) to false.
When I try to test connection of this ODBC DataSource in SSIS I get this error
Test connection failed because of an error in initializing provider.
ERROR [IM004] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle
on SQL_HANDLE_ENV failed
I would specify the entire connection string in the SSIS Data Connection.
You do not need to rely on the ODBC connections defined on the machine (which get buried in the registry) or in files. You can then use SSIS Configuration / Project Parameters to control the details.
I uninstalled the 10g client and installed the 11g client (as the 11g works with 10g databases) and then used an ADO.Net connection with the .Net Providers\OracleClient Data Provider.
This worked, seems the 10g client doesn't play very well with Windows 2008.

visual studio 2010 odbc driver mysql, failed to call ODBC driver connection utility

n win7 64bits, I have Visual Studio 2010 SP1
MySql connector net 6.5.6
MySql connector odbc 5.2.5 winx64
On Localhost I have the MySql database and can connect with MySqlWorkbench.
I have made a user-DSN and a system-DSN on the MySQL database.
In VS2010 I try to make a server Explorer- Data Connection with Micorsoft ODBC Data Source (ODBC) and select the system-data-source name and click OK.
Then I get the message 'Failed to call the ODBC driver connection utility'.
I have tried connector net 6.7.4, but than on a click the window 'add connection' disappears. Connector odbc 5.1.12 does not fix the problem.
In VS2005 on winXP with MySQL odbc 3.51 I can make a connection.
Is there something I miss for VS2010 ?
Deperate looking for a solution, after 2 days of trying :-(
Regards

ConnectionString issues - SQL Server 2008 on Windows 2008

We have a third party program that used to run on Windows 2003 against SQL Server 2000 database (app and db are on same machine). We are trying to migrate/install it on Windows 2008/ SQL Server 2008.
The connection string as specified does not seem to allow it to connect it to SQL Server (see below)
<Configuration name="PROG">
<ADOConnection>
Provider=SQLOLEDB.1;Persist Security Info=False;User Id=sa;Pwd=p#ssw0rd;Initial Catalog=DB_NEW;Data source=servername
</ADOConnection>
</Configuration>
I tried an alternate one and that also does not work
<Configuration name="PROG">
<ADOConnection>
Provider=SQLNCLI10.1;Persist Security Info=False;Initial Catalog=DB_NEW;Data Source=servername;Uid=sa; Pwd=p#ssw0rd;
I was able to use the one below to successfully connect the application to a SQL Server 2008 database on Windows 2003
<Configuration name="PROG">
<ADOConnection>
Provider=SQLOLEDB.1;Persist Security Info=False;User Id=sa;Pwd=p#ssw0rd;Initial Catalog=DB_NEW;Data source=servername
</ADOConnection>
What is the right syntax to get the application to connect to a SQL Server 2008 on Windows 2008 server?
You can check which provider version(s) are installed by looking in the registry:
HKEY_CLASSES_ROOT\SQLNCLI10\Clsid
HKEY_CLASSES_ROOT\SQLNCLI10.1\Clsid (for version 10.1 etc)
The SQLNCLI10 (sql server native client) name is an alias to the latest version installed on the computer. On your 2003 box you will also find entries for sqloledb in the registry which you likely won't have installed on the 2008 box.
I would expect that the following should work:
Provider=SQLNCLI10;Persist Security Info=False;User Id=sa;Pwd=p#ssw0rd;Initial Catalog=DB_NEW;Data source=servername
For more info on the formatting of the connection string and the various provider see: this connectionstring site

Cannot connect to local SQL database using C++ (SQL Server 2008 R2)

I am having issues to connect to a database from a C++ program (VS 2008).
I have created the database using SQL Server and both SQL Server and SQL Server Browser are running, TCP/IP and Remote Access are enabled.
I can connect to my database using sqlcmd, but when I use:
System::Data::SqlClient::SqlConnection ^_SqlConnection = gcnew System::Data::SqlClient::SqlConnection();
_SqlConnection->ConnectionString = "Data Source=MyComp\SQLEXPRESS; Initial Catalog=DbName; Integrated Security=True";
_SqlConnection->Open();
I get the classic error
Named Pipes Provider, error: 40 - Could not open a connection to SQL Server
I have copied the connection string from the database properties found in the Server Explorer of VS, so I guess it's correct.
Thanks a lot for any help.
Found the solution. Correct syntax for connection string is:
"Data Source=MyComp\\SQLEXPRESS; Initial Catalog=DbName; Integrated Security=True";
With 2 back-slashes \\ in the server name.