JTDS not connecting with SQL Server 2008 R2 SP2 + SSL with Java 6 U34-35
Environment:
Windows 7 Pro 32-bit
SQL Server 2008 R2 SP2 (Forced Encryption = Yes, No Certificate provided to server)
Java 6 Update 27-35 and Java 7 Update 2-7
jTDS 1.2.2 and 1.2.6
Under the following setup, our Java application is able to connect to the SQL Server database:
- SQL Server 2008 R2 SP2
- Java 6 Update 27-33 or Java 7 Update 2-5
just switching the JVM to the following would cause the application to be unable to connect to the database:
- Java 6 Update 34 or 35, or Java 7 Update 6 or 7
Browsing through the Java 6 Update 34 release notes, it looks like nothing big was changed, so I'm wondering what has changed with Java 6 U34 and Java 7 U6. I was also looking through a packet sniffer, and indeed the behavior of Java 6 Update 33 and lower was different from Java 6 Update 34 (although I couldn't understand the messages being passed, the number of connections and messages were different).
* This is different from the issue with Java 6 Update 29-30 and Java 7 wherein they were patched for the BEAST SSL vulnerability. That was fixed with the SP2 patch for SQL Server 2008 R2, and for SQL Server 2008 you'd need a hotfix aside from SP3. After patching the server with those updates, Java 6 Update 29-33 and Java 7 U1-5 should be able to connect to the database.
* If I do switch off Force Encryption, all Java versions are able to connect to the database.
Edited by: user1357749 on Oct 12, 2012 1:20 AM
Hi,
It's four months later, but my colleague and I have reproduced the same behavior in both our commercial product, and a very simple example class. It's exactly as you describe it, where the latest versions of both Java 6 and 7 (and several previous versions) hang during the first jTDS SQL query to the DB (immediately after the SSL and handshake). It also happens with the Microsoft JDBC driver.
If you disable the BEAST SSL fix (-Djsse.enableCBCProtection=false), then the connections work without any problems. So, while this is different from the original BEAST SSL problem and subsequent fix, it really seems like some additional changes were made to the fix in a later Java release that broke things.
My colleague has filed a bug with Oracle, and is awaiting a response. We also filed a bug at the jTDS project (#690 - http://sourceforge.net/p/jtds/bugs/690/) that has simple reproduction steps. A contributer at the jTDS project agrees that this seems to be a problem with the JRE, and is not specific to jTDS.
I hope that Oracle will address this issue soon. We need to periodically update the JRE due to vulnerabilities, and we need to have SSL for our JDBC connections for security reasons. This bug puts us and others in a difficult position.
Similar Messages
-
Could not connect to sql server 2008 R2
TITLE: Connect to Server
Cannot connect to SURENDRA-PC\MSSQLSERVER.
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider:
SQL Network Interfaces, error: 25 - Connection string is not valid) (Microsoft SQL Server, Error: 87)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=87&LinkId=20476
BUTTONS:
OKHi Shravan,
According to my research, besides the causes from SQL Server services, firewall, protocol according to other people’s posts, the issue could also be due to the wrong server name, or the remote connections are not allowed. To work around your issue, please
pay attention to the points below.
Firstly, for the local connection to SQL Server default instance, please just type [.] dot or 'localhost','(local)' in server name field according to Shashikant’s post.
Secondly, for the remote connection to SQL Server default instance, please make sure that 'Allow remote connections to this server' is checked in Server Connections properties in SQL Server Management Studio referring to the
article. And just type the computer name in server name field, like SURENDRA-PC.
Regards,
Michelle Li -
How to connect sql server 2008 r2 sp2 with vs2013 ultimate?
how to connect sql server 2008 r2 sp2 with visual studio 2013 ultimate?
Hi Shahzad,
>>how to connect sql server 2008 r2 sp2 with visual studio 2013 ultimate?
Based on your issue, if you wan to connect the sql server 2008 r2 sp2 from VS2013 IDE. I suggest you can try the Ammar and darnold924's suggestion to check your issue.
In addition, I suggest you can also refer the following steps to connect the sql server 2008 r2 sp2 with visual studio 2013 ultimate.
Step1: I suggest you can go to VIEW->SQL Server Object Explorer->Right click SQL Server->Add SQL Server.
Step2: After you connect the SQL Server 2008 r2 sp2 fine, I suggest you can go to VIEW->Server Explorer-> right click the Data Connection->Add Connection.
And then you can create the connect string in the Add Connection dialog box.
Hope it help you!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Add does not run with sql server 2008
Hi all,
My add on in the development environment does not run with SQL SERVER 2008. It ran well with SQL Server 2005 and sap b1 2207 B.
On executing the project file system throws an error "YOU ARE NOT CONNECTED TO THE COMPANY"
we are trying this scenario on a test machine where SAP B1 2007B with temporary license for one month and SQL server 2008
is installed.
Help needed.
Thanking you
PradnyaHi Use this
Dim i as integer
i=oCompany.Connect()
if i<> 0 Then
msgbox(ocompany.GetLastErrorDescription ())
end if
the you will get the error description also use try catch wherever necessary
Alternatively you can use
Dim SboGuiApi As SAPbouiCOM.SboGuiApi
Dim sConnectionString As String
Set SboGuiApi = New SAPbouiCOM.SboGuiApi
sConnectionString = Command
SboGuiApi.Connect sConnectionString
Set SBO_Application = SboGuiApi.GetApplication()
Set ocompany = New SAPbobsCOM.Company 'initialate DI company object
ocompany = SBO_Application.Company.GetDICompany
HTH,
Atul -
Connection pooling with SQL Server 2008 and Tomcat 6.0
Hello Everybody,
I'm creating a web application using struts 2.0 , tomcat 6.0 and sql server 2008.
Everything works fine but i'm unable to create connection pooling with sql server 2008.Please help me to solve this issue.
Code for this is as foolows:
in my META-INF/context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/spas" docBase="spas"
debug="5" reloadable="true" crossContext="true">
<Resource
name="jdbc/spas_new"
auth="Container"
type="javax.sql.DataSource"
maxActive="20"
maxIdle="10"
maxWait="-1"
user="spas_user"
password="spas123"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://HGL-0053\dbo:1433;databaseName=spas_new;responseBuffering=adaptive;"/>
</Context>
in my web.xml
<resource-ref>
<description>SQL Server Datasource</description>
<res-ref-name>jdbc/spas_new</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
and in my ConnectionThread.java file i've used:
Context ctx = new InitialContext();
if(ctx == null )
throw new Exception("Sorry! No Context Exception");
DataSource ds = (DataSource)ctx.lookup("java:/comp/env/jdbc/spas_new");
System.out.println("ds:"+ds);
conn=ds.getConnection();
Following is the exception:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user ''.)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at login.V_SPAS_ConnectionThread.getConnection(V_SPAS_ConnectionThread.java:87)
at org.apache.jsp.login.v_005fspas_005flogin_005fpage_jsp._jspService(v_005fspas_005flogin_005fpage_jsp.java:95)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:345)
at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at login.V_SPAS_SecurityCheckFilter.doFilter(V_SPAS_SecurityCheckFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''.Hi Karthikeyan,
This is not the issue at all. I can open the management studio by the same login id and password and also i can make the database jdbc connection from plain java file.
It does not give me any problem by them.
I'm unable to find the actual problem. May be i'm missing something in connection pooling.
Please help.
Regards
Mina -
Hi
I'm working on upgrading sharepoint 2010 to sharepoint 2013 with sql server 2008 r2. I've ran into some problems but have been able to get a test farm upgraded. However to run SSRS 2013 it seems Sql Server 2012 Reporting Services are required. Upgrading
to a full sql server 2012 database isn't an option. I know that sql server 2012 reporting services can use sql server 2008 r2 as a catalog and content database so I was wondering could this be a workaround? Importantly would I need a separate machine/virtual
machine to host sql server 2012 reporting services? or could it live on the sql server 2008 r2 machine? Any pointers appreciated. Thanks DanRemember that SSRS must be deployed on the SharePoint server. Having said that, yes you can install SSRS 2012 SP1 on a server running SQL 2008 R2. And yes, you can use 2008 R2 as your Database Engine server while SSRS 2012 SP1 runs on the SharePoint server.
Trevor Seward
Follow or contact me at...
  
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
DM 3.1.1 with SQL Server 2008 . Extended Properties not imported .
Hi
I am using Data Modeler 3.1.1 with SQL Server 2008.
I have a database where I have Extended Properties (MS_Description) for the tables and columns.
I use the Import Data Dictionary option (database type SQL 2005) , and the extended properties are not being imported to the model.
Is there anything else that I should do to have the descriptions imported?
Regards,
JorgeHi Fernando
That is what I need to do.
Create a Model from an existing SQL Server database with the Import data Dictionary option , be able to modify tables structures, extended properties in the model, and then sync those changes with the database.
So far I can't import the extended properties with DM 3.1.1. If you find a way , please let me know.
Thanks,
Jorge -
DI Server with SQL Server 2008
Hello.
In the company where I work we develop an application that uses B1WS.
In the development environment had the following characteristics:
SAP Business One 2007 SP01, PL 09
SQL Server 2005 Developer Edition
Windows XP Professional SP 3
SAP Business One Web Services 1.0
At the time we applied to the deploying the SAP Business One version 8.8, but I had a serious problem. The test environment has the following characteristics:
SQL Server 2008 Enterprise Edition
SAP Busines One 8.8 * PL 10
Windows Server 2008
The problem is that when trying to connect to the DI Server generates the following messages:
The TAO NT Naming Service has stopped. (WithOut DBUser and DBPassword)
Unable to access SBO-Common database Login (With DBUser and DBPassword)
I tested the connection directly to the DI Server disponbile by example in the SDK and it generates the same error. For the SAP interface is connected correctly.
DI Server allows connect with SQL Server 2008?
Messagge:
<DatabaseServer>mv-05910a0046</DatabaseServer>
<DatabaseName>Prueba</DatabaseName>
<DatabaseType>dst_MSSQL2008</DatabaseType>
<DatabaseUsername>sa</DatabaseUsername>
<DatabasePassword>12345</DatabasePassword>
<CompanyUsername>manager</CompanyUsername>
<CompanyPassword>12345</CompanyPassword>
<Language>ln_English</Language>
<LicenseServer>mv-05910a0046:30000</LicenseServer>
Thanks
Edited by: Andres Naranjo on May 14, 2010 12:47 AM
Edited by: Andres Naranjo on May 14, 2010 3:56 PM
Edited by: Andres Naranjo on May 14, 2010 3:58 PMHad the same error
'The TAO NT Naming Service has stopped.'
Was using the external IP address for the LicenceServer - which is on the same server as SAP DIserver and B1WS.
I changed to using localhost:30000 and that solved the issue.
I suspect if I had used the internal IP it would have worked as well (ie the one you get from ipconfig) but as it works I'm not going to test that.
HTH -
Unable to connect to SQL Server 2008 from OBIEE 11G(on 64 bit Linux box)
We are unable to connect to connect to SQL Server 2008 from OBIEE 11G which is on 64 bit Red Hat Enterprise Linux.
Infrastructure: OBIEE 11.1.1.5 64bit, on 64 bit Red Hat Linux Enterprise Linux 5.6 , MS SQL Server 2008 on 64 bit Microsoft Windows Server
Issue Description: Unable to connect to SQL Server 2008 from OBIEE11G RPD
Details: We are unable to connect to SQL Server 2008 from OBIEE which is on a 64 bit Linux box. We created the ODBC connection on Linux box to the SQL server. Whenever we try to import metadata it throws an error that says ‘Connection Failed’.
Here are the steps we followed to setup the ODBC connection on Linux box.
1) We updated the user.sh file with the LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 values that point to $ORACLE_HOME/bifoundation/odbc/lib
This is where we found the driver for SQL server SEmsss23.so.
2) We updated the odbc.ini file with the entry for SQL server with the connection details
SI_SQL_Server_DEV = SQL Server
[SI_SQL_Server_DEV]
Driver=/u001_OAS/Oracle/Middleware/Oracle_BI1/bifoundation/odbc/lib/SEmsss23.so
Description=DataDirect 5.1 SQL Server Wire Protocol
Address=10.230.216.52,54970
AlternateServers=
AnsiNPW=Yes
ConnectionRetryCount=0
ConnectionRetryDelay=3
Database=SVBDW_NEW
LoadBalancing=0
LogonID=SIDatavalidation
Password=~~~Password123
QuoteID=No
ReportCodePageConversionErrors=0
3) We updated the IDENTIFIER_QUOTE_CHAR with single quotes instead of double quotes in the DB features of the RPD
4) We updated the bash_profile file to point the ODBCINI variable to the path where the OBIEE odbc.ini file is present.
Export ODBCINI=/u001_OAS/Oracle/Middleware/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/odbc.ini
The error in nqsserver.log file says “[nQSError: 16001] ODBC error state: IM002 code: 0 message: [DataDirect][ODBC lib] Data source name not found and no default driver specified.”Hi,
Make sure SQL Configuration Manager make sure the TCP/IP enabled. please try below method
Method 1
Re Create a new ODBC & Oracle Bi Server DSN Configuration test it and use it in the connection pools.
define your ODBC data source in your server where the BI Server is installed. Check your DB connections in your physical layer and make they are defined on your BI Server as well.
Method 2:
try using the complete TNS in below format in the datasource name section:
(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST =DB IP)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) and provide the credentials.
Method 3:
To use the OCI call interface you need to have oracle client DB to be installed so that you can establish a connection using that DB credentials and connect to the remote dB and then import the tables.....this is the rule of thumb.
hope helps you.
Thanks
Deva -
Vb6,adodb with sql server 2008
hi for i am new to vb6 with sql server 2008. I have managed to create database named : Tuscan77 in project folder with all the necessary tables with primary and foreign keys in tables. I have done the same project in vb6 with adodb with ms access and i have
finished it. But now based on my boss orders i have to connect vb6 with adodb with sql server 2008.
Now below is my code in mdi parent form in vb6 which i used to connect to database in access.:
Dim i As Integer
Dim AccessConnect As String
Dim dBOOL As Boolean
Dim dMstr As String
If (Left(App.Path, 1) = "\") Then
dMstr = Dir(App.Path & "tuscanDB.mdb")
Else
dMstr = Dir(App.Path & "\tuscanDB.mdb")
End If
dBOOL = IIf(dMstr = "", False, True)
If (dBOOL) Then
AccessConnect = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=tuscanDB.mdb;" & _
"DefaultDir=" & App.Path & ";" & _
"Uid=Admin;Pwd=;"
If (adoDatabase.State <> 0) Then
adoDatabase.Close
End If
adoDatabase.ConnectionString = AccessConnect
adoDatabase.Open
Else
Dim mPath As String
CommonDialog1.CancelError = True
CommonDialog1.Flags = cdlOFNHideReadOnly + cdlOFNPathMustExist + cdlOFNFileMustExist
' Set filters
CommonDialog1.Filter = "All Files (*.*)|*.*|RTF (*.rtf)|*.rtf|Text Files (*.txt)|*.txt"
' Display the Save dialog box
CommonDialog1.FileName = ""
CommonDialog1.ShowOpen
dMstr = Dir(CommonDialog1.FileName)
mPath = Left(CommonDialog1.FileName, InStr(mPath, dMstr) - 2)
If (CommonDialog1.CancelError = False) Then
AccessConnect = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & dMstr & ";" & _
"DefaultDir=" & mPath & ";" & _
"Uid=Admin;Pwd=;"
' Connection Object Methods
adoDatabase.ConnectionString = AccessConnect
adoDatabase.Open
End If
End If
where adoDatabase is name of my connection in vb6 with adodb with ms access.
Now how i connect vb6,adodb with sql server 2008?
Now my sql server 2008 details:
Server type: Database Engine
Server name: NPD-4\SQLEXPRESS
Authentication: Windows authentication
User name: NPD-4\TUSCANO
password:(it is left blank or not necessary)
Database name: Tuscan77
How to i connect my Database named Tuscan77 in vb6 and adodb.? Can anyone help me please.Any help or guidance would be greatly appreciated.Hi,
It would be more appropriate to post all your vb6 related queries in the below forums.
http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier
http://forums.codeguru.com/forumdisplay.php?4-Visual-Basic-6-0-Programming
SRIRAM -
Problems with SQL server 2008 nvarchar type to varchar in oracle.
Hello
I did an Heterogeneous Connectivity between SQL server 2008 db and Oracle 11g, so far so good, but when i try to view colum data on RPD (only varchar type) i only see the first character of the string.
One more thing, when i try to see the data on Oracle SQL developer i get some strange characters, like when we have the wrong character encoding on our browser.
Some print to illustrate the problem.
Oracle SQL developer query:
http://postimg.org/image/5cvyqw6ih/
Microsoft SQL developer query :
http://postimg.org/image/skddx991f/
RPD printscreen :
http://postimg.org/image/aok2337cp/
SQLplus (as you can see the are spaces between the characters ) :
http://postimg.org/image/664xw1xjh/
To finish the data will be use to build an mobile app with oracle mobile app designer.
Thank youThe spaces you see between the characters when using the gateway indicate a wrong charset is being used.
1. Which gateway are you using - DG4MSQL or Dg4ODBC?
2. Could you please post the gateway init file and just in case it is DG4ODBC also the odbc.ini file
3. What's the character set of the Oracle database?
4. Looks like you're connected using Putty to a Unix box - what is the Putty NLS setting?
5. What is the NLS setting when starting SQL*Plus and what is the LOCALE setting?
6. Was a NLS_LANG parameter set when the gateway was started? Please change in your gateway init file the HS_FDS_TRACE_LEVEL to DEBUG, then run again the query and post it to a share.
=> There's a note that guides you step by step to configure the gateway and your env correctly - please have a look at:
NLS Guide for Generic Connectivity and Gateways (Doc ID 230239.1)
- Klaus -
Cannot connect to SQL Server 2008 R2 Express
I have a database application that connects to the Northwind sample db in MS Access and lets the user perform CRUD operations.
Now I want to add the same for MS SQL Server, however, I have trouble connecting to it using this connection string:
I changed the server properties in SQL Server Management Studio to allow windows and SQL Server authentication, yet, I still get this exception when trying to open the connection:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I thought it might be because the server is not allowing remote connections and followed this guide to allow remote connections:
http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/
But the SQL Server windows service won't start. The Browser works fine, but the server doesn't do anything.
When trying to start it I get this error:
The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details.
The event log says:
2011-07-07 17:02:55.35 spid51 Starting up database 'Northwind'.
2011-07-07 17:02:59.98 spid51 Starting up database 'Northwind'.
2011-07-07 17:03:03.68 spid53 Starting up database 'Northwind'.
2011-07-07 17:03:07.01 spid55 Attempting to load library 'xpstar.dll' into memory. This is an informational message only. No user action is required.
2011-07-07 17:03:07.30 spid55 Using 'xpstar.dll' version '2009.100.1600' to execute extended stored procedure 'xp_instance_regread'. This is an informational message only; no user action is required.
2011-07-07 17:03:07.76 spid55 Starting up database 'pubs'.
2011-07-07 17:03:08.89 spid55 Starting up database 'pubs'.
2011-07-07 17:03:09.30 spid55 Starting up database 'pubs'.
2011-07-07 17:04:11.37 spid55 Starting up database 'pubs'.
2011-07-07 17:08:17.28 spid52 Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
2011-07-07 17:08:17.35 spid52 Using 'xplog70.dll' version '2009.100.1600' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
However, when starting SQL Server Management Studio, I can normally work with the databases, perform CRUD operations, etc.
I was wondering if it might be a connection string issue.
I'm using this string:
@"Server=lolcalhost;Database=Northwind;User ID=BEN-A350C47E32F;Password=;Trusted_Connection=False;";
I added the Northwind database as data source to the project and the connection string is in the app.config:
<connectionStrings>
<add name="NwindConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Nwind.mdb" providerName="System.Data.OleDb"/>
</connectionStrings>
using this code to access it:
constringServer = ConfigurationManager.ConnectionStrings["NwindConnectionString"].ToString();
but when using this string I get an ArgumentException:
Keyword not supported: 'provider'.
I'd appreciate any help that would let me connect to the server from a program.Here is an active Sql connection string we use currently from our app.config file:
<connectionStrings>
<clear/>
<add name="ServerConnectionString" connectionString="Data Source=SqlBox;Initial Catalog=YourCatalog;User Id=Username; Password=password;" providerName="System.Data.SqlClient"/><br/> </connectionStrings>
here is one for Sql Express:
<add name="LocalConnectionString" connectionString="Data Source=MachineName\SqlExpress;Initial Catalog=YourCatalog;Integrated Security= true;" providerName="System.Data.SqlClient"/> -
I have recently installed SQL Server 2008. When I try to execute a query against an Access database, I receive this debugging error:
"Unable to start Transact-SQL debugger. The Transact-SQL debugger does not support SQL Server 2005 or earlier versions of SQL Server. (SQLEditors)"
Nor will the query execute; I get a transport-level error 0. Any thoughts?Hi Davidmhjr,
>>Unable to start the Transact-SQL Debugger. The Transact-SQL Debugger does not support SQL Server 2005 or earlier versions of SQL Server. (SQLEditors).
Have you tried to restart the server once you have installed SQL Server 2008? As Naomi N mentioned please check the version of SQL Server you are using.
If you tried to connect to SQL Server 2005 from SQL Server 2008 SSMS, you would not be able to debug and get this error, it happens because T-SQL debugger includes both server-side and client-side components. The server-side debugger components are installed
with each instance of the SQL Server 2008 Database Engine. The client-side components are installed when you install the SQL Server 2008 client-side tools.
So it works with SQL Server 2008 only so far. Another way is you can triy to use SQL Server 2005 SSMS to connect to SQL Server 2005.
More information about configuration requirement to run T-SQL debugger as below, please refer:
There are no configuration requirements to run the Transact-SQL debugger when SQL Server Management Studio is running on the same computer as the instance of the SQL Server Database Engine. However, to run the Transact-SQL debugger when SQL Server Management
Studio is running on a different computer from the instance of the Database Engine, you must enable program and port exceptions by using the Windows Firewall Control Panel application on both computers.
On the computer that is running the instance of the Database Engine, in Windows Firewall, specify the following information:
•Add TCP port 135 to the exceptions list.
•Add the program sqlservr.exe to the exceptions list. By default, sqlservr.exe is installed in C:\Program Files\Microsoft SQL Server\MSSQL10.InstanceName\MSSQL\Binn, where InstanceName is MSSQLSERVER for the default instance, and the instance name for
any named instance.
•If the domain policy requires network communications to be done through IPsec, you must also add UDP port 4500 and UDP port 500 to the exception list.
On the computer that is running SQL Server Management Studio, in Windows Firewall, specify the following information:
•Add TCP port 135 to the exceptions list.
•Add program ssms.exe (SQL Server Management Studio) to the exceptions list. By default, ssms.exe is installed in C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE.
Hope it is helpful.
Regards, Amber zhang -
Cannot connect to SQL Server 2008 Express
I install SQL Server 2008 Express on Windows 7 and make sure SQL Server(SQLEXPRESS) service is running. Then I write a program via Visual C++ & ADO, and try to connect to the local SQL Service instance by using the following SQL connection string:
“Provider=sqloledb;Data Source=(local);Integrated Security=SSPI;”
But the connection fails. I try the same code on a computer with SQL Server 2008 Professional installed and it works without problems.
Please advise. Thanks.Hi chcw,
Are you got any error message/information while connect to SQL Server express instance faild via VC++ & ADO? If so, please post them for further investigation.
Please also check the windows firewall. Firewall systems help prevent unauthorized access to computer resources. If a firewall is turned on but not correctly configured, attempts to connect to SQL Server might be blocked. For more information, please see:
http://technet.microsoft.com/en-us/library/cc646023.aspx
If you have any feedback on our support, please click
here.
Regards,
Elvis Long
TechNet Community Support -
ODBC function SQLDriverConnect() crashes with SQL Server 2008 R2
When calling the SQLDriverConnect() function from a 64-bit process and selecting a system DSN with a SQL Server Native Client 10.0 ODBC driver with SQL Server 2008 R2 SP3, then this call crashes here:
sqlncli10.dll!SNIMemRegion::Pop() + 0x77 bytes
sqlncli10.dll!SNIPacketAllocateEx2() + 0xa8 bytes
sqlncli10.dll!Np::ReadSync() + 0x7e bytes
sqlncli10.dll!Ssl::HandshakeReadToken() - 0x1b bytes
user32.dll!InternalDialogBox() + 0x132 bytes
user32.dll!DialogBoxIndirectParamAorW() + 0x56 bytes
user32.dll!DialogBoxParamW() + 0x85 bytes
sqlncli10.dll!SQLDriverConnectW() + 0x34f23 bytes
odbc32.dll!SQLInternalDriverConnectW() + 0x17c bytes
odbc32.dll!SQLDriverConnectW() + 0xa15b bytes
Am I calling SQLDriverConnect() correctly (see below)? Or is this a bug in the 64-bit version of the ODBC driver?
In the 32-bit version, everything works fine.
Here is a test program:
int _tmain(int argc, _TCHAR* argv[])
SQLHENV hEnv = NULL;
SQLHDBC hDbc = NULL;
SQLRETURN ret = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hEnv);
assert(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO);
ret = SQLSetEnvAttr(hEnv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3, 0);
if (ret != SQL_SUCCESS && ret != SQL_SUCCESS_WITH_INFO)
fprintf(stderr, "SQLSetEnvAttr failed\r\n");
return EXIT_FAILURE;
ret = SQLAllocHandle(SQL_HANDLE_DBC, hEnv, &hDbc);
assert(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO);
SQLTCHAR szConnection[2048];
SQLSMALLINT cbChars;
ret = SQLDriverConnect(hDbc, ::GetDesktopWindow(), (SQLTCHAR*) _T(""), SQL_NTS,
szConnection, _countof(szConnection)-1, &cbChars, SQL_DRIVER_PROMPT);
if (ret != SQL_SUCCESS && ret != SQL_SUCCESS_WITH_INFO && ret != SQL_NO_DATA)
fprintf(stderr, "SQLDriverConnect failed\r\n");
return EXIT_FAILURE;
else
fprintf(stdout, "Success\r\n");
return 0;
The stdafx.h contains the following includes:
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include <Windows.h>
#include <sql.h>
#include <sqlext.h>
#include <assert.h>
Steps to reproduce the crash: compile program with Visual Studio 2010 as 64-bit console application; run it and select a 64-bit SQL Server DSN.
If the crash does not occur, try using the "AllocationPreference" registry entry set to 0x100000 (see https://msdn.microsoft.com/en-us/library/windows/hardware/Dn613975%28v=vs.85%29.aspx for details); don't forget to reboot Windows. This registry
helps to find 64-bit portability issues.Hi T.holt,
Personally, I don’t believe SQL 2008 R2 with ADMT 3.2 is supported. From the guidelines of install the Active Directory Migration Tool (ADMT), ADMT v3.2 requires a preconfigured instance of SQL Server for its underlying data store. We
should use SQL Server Express and install ADMT v3.2 on a member server. ADMT installation enforces the following service pack requirements:
• SQL Server 2005 Express must be installed with Service Pack 3 (SP3) or later.
• SQL Server 2008 Express must be installed with Service Pack 1 (SP1) or later.
If you use full versions of SQL Server 2005 or SQL Server 2008. In this case, you need to install and run the ADMT console on a remote computer, and you can run multiple ADMT consoles on different remote computers. If
you use a full version of SQL Server, ADMT installation does not enforce any service pack requirements.
For more information about installing ADMT in the target domain, you can review the following article.http://technet.microsoft.com/en-us/library/cc974370(v=ws.10).aspx
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support
Maybe you are looking for
-
First gen Appletv suddenly stopped working from one night to the next. This has happened in the past once and the usual restore, reboot, etc, tinkering finally snapped it back into working quite unexpectadly. The symptom is, after restore when it get
-
Does canceling music library from HD also erase uploaded iTunes match library?
I am about to sell my iMac, where all of my music library is stored. I have an iTunes match account, with all songs having been uploaded or matched. If I now delete my hard disk library, will I cause the iTunes match library to also be erased when I
-
File display extremely slow with call of OLE_FLUSH_CALL standard function
Hi, We are running SAP R/3 Enterprise 640 with Doculink extension. When trying to display PDF files stored in an SAP Archive Server, it takes quiet a while to retreive the document, while displaying it through a web browser is very fast. I have made
-
Hello All, I am in the process of converting reports from 6i ti 10g. When I run my report in Web Layout nothing shows up. Is it an environment setup issue ? How do fix this issue ? Pls help... Thanks, Anna
-
Cannot install iTunes - failure to run preupgrade script
I get the error message 'failure to run preupgrade script for AppleMobileDevice' when I tried to install itunes. Have tried the steps at this link - http://support.apple.com/kb/HT1747 - but still no luck. Any ideas how I can resolve this?