Showing posts with label failed. Show all posts
Showing posts with label failed. Show all posts

Sunday, March 11, 2012

Connection handshake failed: Unexpected or badly formatted message.

Hello,

I am unable to send a message to a target service on a different SQL Server instance. Using the SQL Profiler, I get the following error from the target machine:

Broker::Connection: Connection handshake failed: An OS call failed: (80090326) 0x80090326(The message received was unexpected or badly formatted.). State 106.

On the initiator side, the transmission_status shows the following error:

An error occurred while receiving data: '64(The specified network name is no longer available.)'.

Any ideas on why the target thinks the message is "unexpected or badly formatted"? Btw, I am specifying the default message type and contract for the services.

Thanks.

The problem is in the NTLM/Kerberos authentification sequence and I reckon I never saw it before. If you only want to get this to work, you can change the endpoint authentication from WINDOWS to CERTIFICATE. If you want to see why is this failing in the first place, I suggest you follow up using the MS Connect site at https://connect.microsoft.com/SQLServer/Feedback?wa=wsignin1.0. A netmon capture of the handhsake sequence would be needed to investigate this.

Connection handshake failed.

Hi.

I created two instances of SQL Server Dev Edition on the same machine.

The two instances acted as the sender / receiver.

However, when the message is transmitted from "Sender" to "Receiver", the following errors are
displayed in "SQL Profiler".

「Connection handshake failed. There is no compatible authentication protocol. State 21.」

How should be dealt with with this?
My best regards.

piknik

Seems like there is a problem with how you've setup your endpoints. Could you paste the script which you used for creating the endpoints? If you don't have that, could you paste the results from this query run on both instances?

select * from sys.service_broker_endpoints

|||

One machine is configured to use CERTIFICATE authentication, the other is configured to use WINDOWS. (or one is configured to use WINDOWS KERBEROS and the other WINDOWS NTLM).

Configure the endpoints to have at least one compatible authentication protocol and it will work.

HTH,
~ Remus

|||

Thank you for the reply.

I used following Script.

[Sender]

USE master
GO

-- Create master key in the master database
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'password62374'

-- Create the certificate for transport security
CREATE CERTIFICATE TransportCert1
FROM FILE = 'C:\Documents and Settings\ryutai\Desktop\Demo\Certs\TransportCert1.cer'
WITH PRIVATE KEY (
FILE = 'C:\Documents and Settings\ryutai\Desktop\Demo\Certs\TransportCert1.pvk',
DECRYPTION BY PASSWORD = 'password62374'
)
ACTIVE FOR BEGIN_DIALOG = ON
GO

-- Create a user in the master db to be associated with
-- the public key from the remote certificate (TestCert2.cer)
CREATE LOGIN remcert WITH PASSWORD = 'password62374'
CREATE USER remcert FOR LOGIN remcert

-- remcert has to have connect priviliges
GRANT CONNECT TO remcert

-- Install the public key from the remote cert in master
CREATE CERTIFICATE TransportCert2
AUTHORIZATION remcert
FROM FILE = 'C:\Documents and Settings\ryutai\Desktop\Demo\Certs\TransportCert2.cer'
ACTIVE FOR BEGIN_DIALOG = ON
GO

-- Switch to the user database
USE SuperMarketServer
GO

-- Create a master key
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'password62374'

-- Create a certificate for dialog security
CREATE CERTIFICATE DialogCert1
FROM FILE = 'C:\Documents and Settings\ryutai\Desktop\Demo\Certs\DialogCert1.cer'
WITH PRIVATE KEY (
FILE = 'C:\Documents and Settings\ryutai\Desktop\Demo\Certs\DialogCert1.pvk',
DECRYPTION BY PASSWORD = 'password62374'
)
ACTIVE FOR BEGIN_DIALOG = ON
GO

-- Create user that holds the remote public key for the dialog security certificate
CREATE USER remcert FOR LOGIN remcert

CREATE CERTIFICATE DialogCert2
AUTHORIZATION remcert
FROM FILE = 'C:\Documents and Settings\ryutai\Desktop\Demo\Certs\DialogCert2.cer'
ACTIVE FOR BEGIN_DIALOG = ON
GO

-- Create a remote service binding associating the remcert user
-- with the remote service
CREATE REMOTE SERVICE BINDING [SellItemBinding]
TO SERVICE 'SellItemService'
WITH USER = remcert,
ANONYMOUS = Off

-- The user has to have SEND permissions
GRANT SEND ON SERVICE::[SoldItemService] TO remcert
go

-- Enable communication between instances by creating an endpoint
CREATE ENDPOINT ServerEndpoint
STATE = STARTED
AS TCP
(
LISTENER_PORT = 5024
)
FOR SERVICE_BROKER (AUTHENTICATION = CERTIFICATE TransportCert1)

-- Finally grant connect permission to user used to secure the dialog
USE master
GO

GRANT CONNECT ON ENDPOINT::ServerEndpoint TO remcert
GO

SELECT * FROM sys.endpoints
--

It is set to "CERTIFICATE authentication" as which Sender and Reciver are the
same.

The sample of Script is put.
http://enterpriselibrary.jp/SampleDemo.zip

My Best Regards.

piknik.


Connection handshake failed - easiest possible configuration

Hi there!

Often discussed, but not really solved in my opinion - the connection between the partners and the witness causes problems.

My case: Three Servers in the same domain, three endpoints on 5022 with windows negotiation, all endpoints can be reached by telnet from each server. Mirrorring works. So far so good.

But one of these partners is not able to connect to the witness. The witness' error log is full with that:

"2006-06-01 13:45:20.32 Logon Database Mirroring login attempt failed with error: 'Connection handshake failed. An OS call failed: (8009030c) 0x8009030c(Der Anmeldeversuch ist fehlgeschlagen.). State 67.'. [CLIENT: 130.143.205.54]"

My Endpoints are created like

CREATE ENDPOINT [EASYRIS_Mirroring]

AUTHORIZATION [code1\dephbrsaa1-sys108]

STATE=STARTED

AS TCP (LISTENER_PORT = 5022, LISTENER_IP = ALL)

FOR DATA_MIRRORING (ROLE = PARTNER, AUTHENTICATION = WINDOWS NEGOTIATE

, ENCRYPTION = SUPPORTED ALGORITHM RC4);

What catches my eyes is that

GRANT CONNECT ON ENDPOINT::EASYRIS_Mirroring TO [code1\dephbrsaa1-sys108];

doesn't cause these user to appear in the result set of

SELECT EP.name, SP.STATE,

CONVERT(nvarchar(38), suser_name(SP.grantor_principal_id))

AS GRANTOR,

SP.TYPE AS PERMISSION,

CONVERT(nvarchar(46),suser_name(SP.grantee_principal_id))

AS GRANTEE

FROM sys.server_permissions SP , sys.endpoints EP

WHERE SP.major_id = EP.endpoint_id

ORDER BY Permission,grantor, grantee;

By the way, these mentioned user is sysadmin and grantor.

Has anyone an idea?

Torsten

So,

The 8009030c error from the OS indicates that there is a login error at the OS level. SQL isn't involved with the networking protocol yet. So, look at the credentials that SQL Server is running under. There may need to be a restart of the SQL Server process to pick up the new credentials.

Thanks,

Mark

|||

Hi Mark,

thanks, that was the missing information. I could resolve the issue:

It seems that 1. the SQL Server Processes of each partner and the wittness has to run under an equal domain user and 2. these domain user must be local admin.

Can someone confirm these thesis?

Thanks a lot, Torsten

|||

You do not have to run all the same accounts and run as the SA to setup mirroring. It is just that the easiest way to setup mirroring is to have all the accounts be the same and SA.

You can use different accounts on the servers, but they need to be granted access to the other endpoints.

You can also run as local system accounts, but you need to setup certificattes. It is all in BOL.

Thanks,

Mark

Connection from XP SP2 to Windows 2003 R2 with SQL Server 2005 failed

I cannot make named pipe connection with client by ODBC DSA.

Here is information. Refering to http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=362498&SiteID=1.

[1] Client side:

1. What is the connection string in you app or DSN? (please specify) ODBC \\[SERVER_NAME]\pipe\sql\guery

2. If client fails to connect, what is the client error messages? (please specify) Connection failed: SQLState: ’01000’ SQL ServerError: 1326 [Microsoft][ODBC SQL Server Driver][Named Pipes]connectionOpen (Connect()) Connection failed: SQLState: ’08001’ SQL Server Error: 17 [Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not exist or access denied.

3. Is the client remote or local to the SQL server machine? [Remote | Local]

4. Can you ping your server? [YES | NO ]

In cmd.exe console, type “ping -a <server_name>”.

5. Can you telnet to your SQL Server? [YES | NO, please specify the error message ]

In cmd.exe console, type “telnet <server name> port, where port can be 135, 445 or sql_server_tcp_port. If your cmd.exe console turns into a complete black screen with a cursor flushing on top left corner, you are connected. Type ctrl+’[‘ to bring up telnet prompt and type “quit” <enter>.

6. What is your client database provider? [SNAC | MDAC | ADO.NET1.0 | ADO.NET2.0| other ODBC (please specify] Or/And, what is your client application? [SQL Management Studio | SQL Profiler | Visual Studio | Other (please specify).

7. Is your client computer in the same domain as the Server computer? (Same domain | Different domains | WorkGroup)

8. What protocol the client enabled? [Shared Memory | TCPIP | Named Pipes].

9. Do you have aliases configured that match the server name portion of your connection string? If so, please check if it is correct. You can use cliconfg.exe (SS 2000) or SQL Server Configuration Manager (SS 2005) to configure the alias. [NO]

10. Do you select force encryption on server and/or client? [NO]

I was able to connect with TCP/IP settings.

[2] Server side:

1. What is the MS SQL version? [SQL Server 2005]

2. What is the SKU of MS SQL? [Enterprise | Standard | Workgroup | Express (or MSDE) | other (please specify)].

3. What is the SQL Server Protocol enabled? [Shared Memory | TCPIP | Named Pipes ]. Use SQL Server Configuration Manager to configure it and check ERRORLOG or event log to confirm.

4. Does the server start successfully? [YES | NO] If not what is the error messages in the SQL server ERRORLOG?

5. If SQL Server is a named instance, is the SQL browser enabled? [YES | NO]

6. What is the account that the SQL Server is running under?[Local System | Network Service | Domain Account]

7. Do you make firewall exception for your SQL server TCP port if you want connect remotely through TCP provider? [YES | NO | not applicable | not enabled]

8. Do you make firewall exception for SQL Browser UDP port 1434? In SQL2000, you still need to make firewall exception for UDP port 1434 in order to support named instance.[YES | NO | not applicable | not enabled]

I could connect locally with named pipes.

Do I have to make some file shares manually?

[2a] Tool Used to Connect

What tool or Application are you using to connect to SQL Server (eg: Visual Studio, SQL Server Management Studio, SQLCmd.exe, OSQL, etc) and especially the version of SQL Server (Express, Workgroup, Standard, Enterprise, Developer)

[3] Platform:

1. What is the OS version? [Windows XPSP2 | Windows 2003 | Windows 2000 | Windows 98 | others (please specify ) ].

1. Server [Windows Server 2003 R2]

2. Client [Windows XP SP2]

2. Do you have third party antivirus, anti-spareware software installed? [Symantec | Norton | other (please specify) ? NO].

[4] Misc:

1. If you have certificate configuration issue: Please use “certutil.exe –v –store my” to dump certificate specific info and post it in your question. [NO]

What happens if you execute
net use \\[server_name]\ipc$
from the client?

connection from SQLS database to Visual Studio. Timeout failed.

I have a databse in SQL Server 2005 Sept Beta 2. On another partition I have Visual Studio 8. I want to establish a connection between the two.

Doing it programmatically in a C# code program fails.The connection string does not give me an error on debug.

Doing it via GUI in VS fails on the account of "timeout failed..."

I tried to copy the whole database from SQL Server directory into VS directory - the same result.

Amazingly, I was able to connect to my FoxPro 9 database with no problem. Also an Access database is connected.

Is there a way to increase this parameter: timeout? Where is set up?

Thanks.Most likely the SQL Server is not running. Is this the same machine (SQL Server and VS)? Copying files is not necessary. Being on different partitions is ok as well. Can you connect using sqlcmd? If not, what is the error message you get?

When you type 'net start' in the command line do you see SQL Server started? Or check services in the Control Panel.

Boris.

Connection from ASP- ODBC vs. SQLOLEDB

I am having a problem in an ASP site (HTTP/1.1:New application failed which
I believe has been caused by inefficient database connections/memory leaks).
One of the recent changes to the way connections are made is
changed connection string from
driver={SQL Server};server=production;uid=pub;pwd=pub;
database=pub
to
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=pub;Data Source=Production
I thought that the OLE DB Provider is quicker/more efficient than the ODBC
driver for SQL Server, isn't it (although in one of the ASP file, I had to
change the CursorLocation used by ADO Recordset from adUseServer to
adUseClient to get a specific ASP file functioning).
Would I normally expect any other adverse outcome switching from ODBC to
SQLOLEDB ?Hi Patrick,
Thank you for using the newsgroup an it is my pleasure to help you with you
issue.
As for you question of when develope ASP application, which is the
recommended method to connect the database, from my experiece, for the
script, ADO is preferable.
1) ODBC is an API for database access that's both a formal and a de facto
industry standard. Besides being one of the most popular database
interfaces used by applications today, ODBC has gained status as the formal
call-level interface standard by American National Standards Institute
(ANSI) and International Organization for Standardization (ISO). SQL Server
provides a high-performance ODBC interface for all Windows-based
programming environments, and it can be distributed royalty-free with any
application. The SQL Server ODBC driver implements every function in the
ODBC 3 specification. In ODBC-speak, this makes it fully Level 2 (the
highest level) conformant.
RDO is an object interface that's closely tied to ODBC, which means that it
exposes all the functionality in the ODBC driver and is easily available to
Visual Basic programs. RDO supports building visual controls tied directly
to SQL Server data, which greatly reduces the amount of code that must be
written to display data on the screen.
2) OLE DB
OLE DB was first released by Microsoft in 1996 to provide a COM interface
to any tabular data source (that is, data that can be represented with rows
and columns). This includes data in spreadsheets and even text files. OLE
DB can be considered an object version of ODBC but is more powerful in that
it can access data from data sources beyond those that ODBC can access.
Unlike other object interfaces to SQL Server such as RDO, OLE DB doesn't
make programming a call-level interface like ODBC any easier. Also, because
OLE DB uses pointer data types extensively, it's only accessible from C and
C++.
3) ADO
ADO is a higher-level object interface on top of OLE DB that provides much
of the same functionality and performance. Because ADO is pointerless, it
can be accessed from scripting languages such as JScript and development
software such as Visual Basic, as well as from C and C++.
ADO is the recommended and supported interface for Internet applications
written using the Microsoft Visual InterDev development tool. Applications
written with Visual InterDev can call ADO from Active Server Pages (ASP)
and incorporate code written in VBScript or JScript.
For more information, I recommend you to ask you question in our related
newsgroup and the right engineer there will provide you detailed answer
about it:
http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.publi
c.inetserver.asp.general
Hope this helps.
Best regards
Baisong Wei
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.|||The ASP code is already using ADO (adodb.connection, adodb.recordset
objects). However, the connectionString used for opening a DB connection
has been changed from
driver={SQL Server};server=production;uid=pub;pwd=pub;database=pub
in old environment to
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=pub;Data Source=Production
in new environment
The new provider is better than ODBC isn't it, in terms of the underlying
way ADO use to connect to SQL Server 2000?
Also, could any of the following have any effect on memory usage (e.g., poor
garbage collections in terms of not closing connections):
- SQL Server Client Network Utility- "Enable Shared Memory": I am not sure
whether this should be ticked or not. The Server is a Windows 2000 Server
SP4 which is a Domain Controller, running SQL Server 2000 Standard Edition,
ASP, ASP.NET as well as Microsoft Content Management Server 2002 SP1a. (The
application that has failed is the ASP application connecting using ADO)
- SQL Server Client Network Utility- Protocol: Should Named Pipes be used in
preference to TCP/IP
?
"Baisong Wei[MSFT]" <v-baiwei@.online.microsoft.com> wrote in message
news:5JdW06MAEHA.320@.cpmsftngxa06.phx.gbl...
> Hi Patrick,
> Thank you for using the newsgroup an it is my pleasure to help you with
you
> issue.
> As for you question of when develope ASP application, which is the
> recommended method to connect the database, from my experiece, for the
> script, ADO is preferable.
> 1) ODBC is an API for database access that's both a formal and a de facto
> industry standard. Besides being one of the most popular database
> interfaces used by applications today, ODBC has gained status as the
formal
> call-level interface standard by American National Standards Institute
> (ANSI) and International Organization for Standardization (ISO). SQL
Server
> provides a high-performance ODBC interface for all Windows-based
> programming environments, and it can be distributed royalty-free with any
> application. The SQL Server ODBC driver implements every function in the
> ODBC 3 specification. In ODBC-speak, this makes it fully Level 2 (the
> highest level) conformant.
> RDO is an object interface that's closely tied to ODBC, which means that
it
> exposes all the functionality in the ODBC driver and is easily available
to
> Visual Basic programs. RDO supports building visual controls tied directly
> to SQL Server data, which greatly reduces the amount of code that must be
> written to display data on the screen.
> 2) OLE DB
> OLE DB was first released by Microsoft in 1996 to provide a COM interface
> to any tabular data source (that is, data that can be represented with
rows
> and columns). This includes data in spreadsheets and even text files. OLE
> DB can be considered an object version of ODBC but is more powerful in
that
> it can access data from data sources beyond those that ODBC can access.
> Unlike other object interfaces to SQL Server such as RDO, OLE DB doesn't
> make programming a call-level interface like ODBC any easier. Also,
because
> OLE DB uses pointer data types extensively, it's only accessible from C
and
> C++.
> 3) ADO
> ADO is a higher-level object interface on top of OLE DB that provides much
> of the same functionality and performance. Because ADO is pointerless, it
> can be accessed from scripting languages such as JScript and development
> software such as Visual Basic, as well as from C and C++.
> ADO is the recommended and supported interface for Internet applications
> written using the Microsoft Visual InterDev development tool. Applications
> written with Visual InterDev can call ADO from Active Server Pages (ASP)
> and incorporate code written in VBScript or JScript.
> For more information, I recommend you to ask you question in our related
> newsgroup and the right engineer there will provide you detailed answer
> about it:
>
http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.publi
> c.inetserver.asp.general
> Hope this helps.
> Best regards
> Baisong Wei
> Microsoft Online Support
> ----
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
> Please reply to newsgroups only. Thanks.
>|||Hi Patrick,
Thank you for your update.
In my last reply, I just want to say to choose the OLEDB, sorry for the
mistype. For you questions, I will answer them one by one
1)As for the ASP will use the ADO to connect the database and in my last
email, I said ADO is a higher-level object interface on top of OLE DB, so
the level of connect the database would be:
For the provider of OLEDB:
ASP -> ADO -> OLEDB -> Database
For the the provider of ODBC:
ASP -> ADO -> OLEDB -> ODBC -> Database
Also, if the database is SQL Server, you could get for more from OLEDB for
both of them are Microsoft technologies.
Please refer to the following link for detailed information
Choosing Your Data Access Strategy
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoledb/htm
l/choosingcomponents.asp
2) Named Pipes vs. TCP/IP Sockets
In a fast local area network (LAN) environment, Transmission Control
Protocol/Internet Protocol (TCP/IP) Sockets and Named Pipes clients are
comparable in terms of performance. However, the performance difference
between the TCP/IP Sockets and Named Pipes clients becomes apparent with
slower networks, such as across wide area networks (WANs) or dial-up
networks. This is because of the different ways the interprocess
communication (IPC) mechanisms communicate between
peers.
For named pipes, network communications are typically more interactive. A
peer does not send data until another peer asks for it using a read
command. A network read typically involves a series of peek named pipes
messages before it begins to read the data. These can be very costly in a
slow network and cause excessive network traffic, which in turn affects
other network clients.It is also important to clarify if you are talking
about local pipes or network pipes. If the server application is running
locally on the computer running an instance of Microsoft SQL Server?2000,
the local Named Pipes protocol is an option. Local named pipes runs in
kernel mode and is extremely fast.
For TCP/IP Sockets, data transmissions are more streamlined and have less
overhead. Data transmissions can also take advantage of TCP/IP Sockets
performance
enhancement mechanisms such as windowing, delayed acknowledgements, and so
on, which can be very beneficial in a slow network. Depending on the type
of
applications, such performance differences can be significant.TCP/IP
Sockets also support a backlog queue, which can provide a limited smoothing
effect compared to named pipes that may lead to pipe busy errors when you
are attempting to connect to SQL Server.
In general, sockets are preferred in a slow LAN, WAN, or dial-up network,
whereas named pipes can be a better choice when network speed is not the
issue, as it
offers more functionality, ease of use, and configuration options. You
could just choose which protocol to use depends on you production
environment.
3) As for Shared Memory Net-Library is used only for intra-computer
communications, you could let it as the default setting on the client
network utility.
Hope this helps!
Best regards
Baisong Wei
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.

Thursday, March 8, 2012

Connection faileed Package abort

Hello,

I am connecting with various sqlservers in a package to get the information. If connection failed with any sqlserver, package failed after 3 tries.

I would like that if connection failed with any sqlserver, package should not end rather move ahead and connecto next sqlserver.

I already tried to increase the number of error from 3 to 1000 but still package failed as soon sqlserver connection failed.

Any help is appreciated.

Thanks.

--

Farhan

There's quite a numbers of options for "on error resume next" style execution in SSIS. Consider precedence constraints,

the System::Propagate OnError event handler variable, and the

MaximumErrorCount and ForceExecutionResult properties.

One way to continue execution despite failure is to use Completion or Failure precedence constraints rather than Success constraints. When using Completion style precedence, execution will continue, and the package will fail by default due its max error count having been exceeded.

Another way to continue despite task errors is by setting ForcedExecutionResult of the tasks. Here again, execution will continue post failure, and the package will exit with a failure status due to the default max failure count (unless you set ForceExecutionResult on the package itself). This is effectively completition style precedence, except different events are fired. The OnTaskFailed event is not fired here, since the task "did not fail".

Another option is non-bubbling errors via System::Propogate in an OnError event handler. This approach will keep the error(s) from bubbling up the container

hierarchy, excepting validation errors. The task may fail, but the

package will succeed, because the task's execution errors never bubbled

up.

To use non-bubbling errors, create an error event handler on the failing task(s), and set the System::Propagate variable to false. Use this option in combination with completion based constraints when you want a package result of success despite failed tasks and want the failed tasks logged as such. Also, using the non-propagating error tactic, the OnTaskFailed event is fired, so you can hook that for logging purposes if need be.|||

Many thanks, I will give it a try.

You are the only who have replied, glad someone out there who knows and wants to help.

connection failed: SQLstate: 28000

I have SQL 2000 installed in my windows 2003 server with mixed mode authentication. When I login to the server and open the SQL server manager under my windows name everything works. And if I try to create an odbc connection from one of the client pc's or from the server itself using windows authentication still everything works. Now I opened the SQL enterprise manager and in the Security section, there is a user group called BUILTIN\Administrators, I was asked to deny access to this group in SQL. So I did that and added my windows login name in the security -> Login section. Now still if I try to open the enterprise manager and and login to sql under my windows login name it works. But if I try to create an odbc connection to the sql server either from the server itself or from the client work station I get the following error:

connection failed:
SQLstate: '28000'
SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'PROD\pchelin'

If I go to the security -> Login and enable BUILT\Aministrators group, everything works. But I would like to know how to disable that group and add my own windows group or login id in SQL server and connect using ODBC.

Your valuable feedback is greatly appriciated.

Hi,

I do not know which user you use to connect to SQL server except your login, and I have no idea if you are a member of built\Administrators group, but I know that if you deny Access to server for group even if user itself had rights to access server this DENY will prevent user to log into SQL Server.

I hope that it helps

JPazgier

|||

You are correct. The moment I deleted the BUILT/Administrators group it started to work. Are there any disadvantages in deleting this group?

|||

If it was windows group it is not safe to delete it. It will be good practice to create another group like SQLAdministrators and give its users rights to be admins on SQL server. The only problem can be that administrators have by default rights to SQL server so you have to just remove this rights to SQL server but do not set Deny access.

JPazgier

Connection Failed: SQl SErver Error 18456

I am runnig a program through Microsoft Access 2000 that uses SQL server and is run on 8 different machines. It has worked great for months but yesterday this message appeared:

Connection Failed:
SQL State: '28000'
SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login Failed for User 'SA'.

And when I try to use Outlook, this message is displayed:

The Microsoft Exchange Server Computer is not available. Either there are network problems or thhe Microsoft Exchange Server is down for mmaintenance.

Obvious problems with the SQL recognition but it seems to be up and running fine.

Any help appreciated.Make sure no change in SA's password and try connecting with other user with ADMIN privileges.

Connection failed: 18456 error

When one of my users creates an ODBC connection to a SQL database using Windows authentication, he gets this error:

Connection failed: SQLState: '28000' SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'Domain\username'

The thing is, the 'Domain\username' is not his username and I have no idea where or why it is trying to use that username.

Ideas?

Hi Mike,

You are using integrated security to your sql connection. You would have to use: Server=yourServer;Database=yourDatabase;User Id=somebody;Password=yourpassword;

Good Coding!

Javier Luna
http://guydotnetxmlwebservices.blogspot.com/

|||

Hi Mike,

If I read your post correctly, your intention is to use Windows auth, correct? If so, then make sure that you use the "Trusted_Connection=Yes" connection string attibute and remote the username and password attibutes. This will make SQL Server authenticate you based on the credentials under which your client application is running.

Further information regarding the 18456 error can be found here: http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

Il-Sung.

|||

I should have been more clear.

He is not doing any coding. We are just manually creating an ODBC data source system DSN using the ODBC Data Source Administrator.

I was just hoping somebody here had run across situation when creating a data source using Windows NT authentication the connection would fail because it was trying to use another username for some odd reason.

|||

I don't have any problems using the ODBC DSN Administrator and integrated auth. Did you make sure that "With Integrated Windows Authentication" was selected on the "How should SQL Server verify the authenticity of the login ID" prompt?

Il-Sung.

|||Sure did, and this is the only person having this issue. It is just so strange that it is trying to use some other username. I wouldnt' be suprised if not very many people have run into this. Bizzare.|||

This is very strange. I tried connecting using integrated auth with both Sql Native Client and MDAC, and in both cases, if I connect with an invalid account, the error message displays the domain name of the actual user. What is the corresponding 18456 error message in the server's error log?

Il-Sung.

Connection failed:

Hi Guys,

I encountered an error while opening my third SQL Connection in Enterprise Manager

--------
Microsoft SQL Server Login
--------
Connection failed:
SQLState: '01000'
SQL Server Error: 232
[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionWrite (WrapperWrite()).
Connection failed:
SQLState: '08S01'
SQL Server Error: 11
[Microsoft][ODBC SQL Server Driver][Shared Memory]General network error. Check your network documentation.

--------
OK
--------

I am using the following
SQL Server 2000 Enterprise Edition (SP4)
Windows 2000 Professional (SP4)

first two connections are with Query Analyzer, the third attempt is when opening a table inside Enterprise Manager

anyone experienced this?Sounds like you have to enable the shared memory protocol for the instance in cliconfg.exe.|||hi MCrowley

yeah, but the problem is, I can't remember what I did (gosh, too much for making experiments :) )

Is there a way on how to reverse this effect?

Thanks|||Is the Shared Memory protocol enabled in Cliconfg.exe?|||Is the Shared Memory protocol enabled in Cliconfg.exe? ;)|||The first thing I would do if I were in your position would be to check the setting of Shared Memory Protocol in cliconfg.exe and make sure it is enabled.

Just my .02 :)|||gosh,

sorry for the very late reply

yes, its enabled, what does this option do by the way?

thanks|||Shared memory is a protocol that can be used by applications running on the same box as SQL Server. Now that it is enabled, do you still get the same error?

connection failed... not associated with a trusted SQL Server connection

Using Query Analyser, I cannot log in using the SQL 'sa' user name and
password. I get an error saying "connection failed... not associated with a
trusted SQL Server connection" When and where can the 'sa' credential be
used without creating this error?
thanks,
KeithHi,
Change the authentication mode to Windows and SQL server and try connecting
using SA.
How to change:-
1. In Enterprise Manager -- Expand the Server
2. Right click on the server name and select propertirs
3. Choose the security Tab and select SQL Server and Windows
4. Click ok and restart the windows service.
Thanks
hari
SQL Server MVP
"keithb" <k31thb@.yahoo.com> wrote in message
news:utbk$LIuFHA.3740@.TK2MSFTNGP14.phx.gbl...
> Using Query Analyser, I cannot log in using the SQL 'sa' user name and
> password. I get an error saying "connection failed... not associated with
> a trusted SQL Server connection" When and where can the 'sa' credential be
> used without creating this error?
> thanks,
> Keith
>

connection failed... not associated with a trusted SQL Server connection

Using Query Analyser, I cannot log in using the SQL 'sa' user name and
password. I get an error saying "connection failed... not associated with a
trusted SQL Server connection" When and where can the 'sa' credential be
used without creating this error?
thanks,
Keith
Hi,
Change the authentication mode to Windows and SQL server and try connecting
using SA.
How to change:-
1. In Enterprise Manager -- Expand the Server
2. Right click on the server name and select propertirs
3. Choose the security Tab and select SQL Server and Windows
4. Click ok and restart the windows service.
Thanks
hari
SQL Server MVP
"keithb" <k31thb@.yahoo.com> wrote in message
news:utbk$LIuFHA.3740@.TK2MSFTNGP14.phx.gbl...
> Using Query Analyser, I cannot log in using the SQL 'sa' user name and
> password. I get an error saying "connection failed... not associated with
> a trusted SQL Server connection" When and where can the 'sa' credential be
> used without creating this error?
> thanks,
> Keith
>

Connection Failed.

Hi everyone, I need help.

I am using Windows Server 2003, VS.NET 2003 and SQL 2000&sp3 on same PC. I was try to run the samples from Framework DSK v1.0 and v1.1, both failed on SQL connection. No matter sa or ASPNET userID, can't make it works.
I can run these samples on Windows 2000, VS.NET 2002 and SQL 2000&sp3 without problem, also runs on Windows XP, VS.NET 2002, SQL 2000&sp3 with WC service on my notebook.

Any particular section I should scope it for troubleshooting?

Thanks for any suggestion on this issue.You have to help us a little. EXACTLY what is the error message.|||The error message is:

Login Failed for user 'NT Authority\Network Service'.

Lin 4: sqlDataAdapter1.Fill(dSet) is in Red.

Thank you for helping me.|||I imagine you are using integrated security to try and connect to SQL Server.

This might help
You need to add the Network Service user into SQL Server, or use a username and password, if your SQL Server will allow it.|||Actually, I try the Integrated Security and Trusted_Connection both ways, neither of these works. I was thinking the IIS 6.0 security features on Windows server 2003 may block connection to SQL server. While, I will try to add the password to sa and hope get succeed at this time.

Thank you very much.|||Hi Douglas,

It works right now. In my case, Windows server 2003, IIS 6.0, .Net 2003 and SQL 2000server are configuring correctly but one thing I forget (Usually I do, but not this time) that is the ODBC configuration for default user ID. Well, thanks again for your helpful opinion.

Have a nice day.

Connection failed!

Hi guys,

I have problem with this code:

TCHAR szCurrentDir[250];

TCHAR szDataDir[250];

lstrcpy(szDataDir,

TEXT("DRIVER={SQL Native Client};SERVER=.\\sqlexpress;Trusted_Connection=Yes;DATABASE=MyDic;AttachDBFileName="));

GetCurrentDirectory(sizeof(szCurrentDir), szCurrentDir);

lstrcat(szCurrentDir, TEXT("\\Database\\Data.mdf;"));

lstrcat(szDataDir, szCurrentDir);

SQLDriverConnect(hdbc, hWnd, szDataDir, SQL_NTS, szConnStrOut, sizeof(szConnStrOut), &cbConnStrOut, SQL_DRIVER_COMPLETE);

When I run my program, I get this message:


Microsoft SQL Server Login
Connection failed:
SQLState: '42000'
SQL Server Error: 5133
[Microsoft][SQL Native Client][SQL Server]Directory lookup for the file "C:\Program Files\MyDic\Database\Data.mdf" failed with the operating system error 5(Access is denied.).
Connection failed:
SQLState: '42000'
SQL Server Error: 1832
[Microsoft][SQL Native Client][SQL Server]Could not attach file 'C:\Program Files\MyDic\Database\Data.mdf' as database 'MyDic'.


OK

I have to mention that:

SQL Server: SQL Server (2005) Express

Operating System: Windows XP SP2

and I'm Local Admin.

I wanna deploy this program with data.mdf file that contains program data.

So, How can I fix it?

Regards

Curious issue. It looks like your connection string is correct. Can you check to see if your detached database's assocated .LDF file is read-only? (I had that issue before.) If it doesn't have one, then ignore this suggestion.

Another thing you might try is to see if putting your detached database into the SQL Server's 'Data' folder. Something along the lines of 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data'. Again, probably not the issue since you're getting an 'access denied' error, not one about 'file not found'.

Did you detach with same version SQL server? This could be a compatibility issue.

It almost sounds like you're trying to attach a database that already exists. Could this be possible?

Try to debug your issue with the following steps:

1) Create a database, with tables, etc...

2) Detach the database

3) drop the database

4) try to re-attach the database using a connection string like the one above.

If you can get this to work then you should be okay.

If you're still stuck, re-activate this issue and I'll try to think of something else.

~Warren

|||Does C:\Program Files\MyDic\Database\Data.mdf exist? Does the service account for your sqlexpress has permissions to read/write this file? You must have at least read permission to the file to logon to the server. (You cannot relay on sqlexpress create the file for you.)|||

Dear Warren,

I have checked all things you mentioned, but it doesn't work

I think this issue is concerned with the service account for my SQLEXPRESS as Xinwei Hong mentioned.

Well, Do you know how I can change this account programmatically so that I could get rid this issue?

Best

|||

Dear Xinwei,

I think you are right. But how can I change the service account programmatically in order to have read and write permission?

Thanks,

|||

I don't think you need to change the service account programmatically. You can just give the read/write permission to the service account. Do you have any special reason that you don't want to give the permission to the SQL service account on your computer?

Thanks.

|||

That's a tough one. I guess the easiest way would be to create an 'sa' login on your SQL Server installation, and then replace 'Trusted_Connection' with 'User=sa;Pwd=<<WhateverPasswordYouCreated>>;'.

This would guarantee you have admin rights to attach/detach databases.

Second easiest would be to log onto machine as admin, and add your user name as a machine admin. (I’m afraid I’m not too good at showing how to do that on an XP machine, since I only use W2K3 Server.)

The more difficult method to do this programmatically would be to use “Runas”. I’m not positive it would work, but you could try running your application from the command line via ‘Runas admin’ which would give it admin rights, and it should work. Please see http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/runas.mspx?mfr=true for more documentation on how to use this.

If anyone else has suggestions, please speak up!

Good luck!

~Warren

|||

Hi Xinwei,

As I said before, I just wanna deploy my program containing data.mdf file. I made installation and I tested but I got this problem. I read some technique to deploy MDF files such az Xcopy, but it didn't work.

sincerely.

|||

Hi Warren,

Thank you for your comments.

By the way, I read this article:

"How to verify and change the system administrator password in MSDE or SQL Server"

http://support.microsoft.com/Default.aspx?scid=kb;en-us;322336&spid=2855&sid=global

But when I created sa, sqlcmd said that sa account disabled. Do you know how I can enable it?

Thanks.

|||

Look here:

http://msdn2.microsoft.com/en-us/library/ms188670.aspx

|||

Dear Markus,

Thank you so much. I got that.

Regards.

connection failed when using IP address

I am trying to connect to MSDE 2000a server over the internet. I have check
and open the ports on my router pointing it to my server (1433 & 1434). But
I am still not able to connect. (Check log and port is 1433)
Does anyone know what I can try or do to resolve this problem (I have all th
e latest patches)?Hi,
Execute "srvnetcn.exe" from command prompt from the server running MSDE. In
the display scrren,
verify that tcp/ip and named pipes are enabled for the MSDE instance. If
not, enable them and then stop and
start MSDE service and try again.
Thanks
Hari
MCDBA
"dee" <anonymous@.discussions.microsoft.com> wrote in message
news:D6817B6C-6392-4BC6-9D8A-A80D9400A264@.microsoft.com...
> I am trying to connect to MSDE 2000a server over the internet. I have
check and open the ports on my router pointing it to my server (1433 &
1434). But I am still not able to connect. (Check log and port is 1433)
> Does anyone know what I can try or do to resolve this problem (I have all
the latest patches)?

connection failed when using IP address

I am trying to connect to MSDE 2000a server over the internet. I have check and open the ports on my router pointing it to my server (1433 & 1434). But I am still not able to connect. (Check log and port is 1433)
Does anyone know what I can try or do to resolve this problem (I have all the latest patches)?
Hi,
Execute "srvnetcn.exe" from command prompt from the server running MSDE. In
the display scrren,
verify that tcp/ip and named pipes are enabled for the MSDE instance. If
not, enable them and then stop and
start MSDE service and try again.
Thanks
Hari
MCDBA
"dee" <anonymous@.discussions.microsoft.com> wrote in message
news:D6817B6C-6392-4BC6-9D8A-A80D9400A264@.microsoft.com...
> I am trying to connect to MSDE 2000a server over the internet. I have
check and open the ports on my router pointing it to my server (1433 &
1434). But I am still not able to connect. (Check log and port is 1433)
> Does anyone know what I can try or do to resolve this problem (I have all
the latest patches)?

Connection failed to local SQL server

Hello,
One day when i try to open my database om my local computer (Win 2000
server, SQL 2000 EE, sp3) i get message:
A connection could not be established to (LOCAL)
Reason: cannot open user default database. Login faied..
Please verify SQL Server is running and check your SQL Server
registration properties (by right-clicking on the (LOCAL) node) and try again.
SQL Server is running and right-clicking produces just the same message.
Can anybody say what happend and what to do.
Thanks a lot.1. check which database is default database for your login
2. default database exist on server?
3. check permissons on your default database
"olsh" wrote:
> Hello,
> One day when i try to open my database om my local computer (Win 2000
> server, SQL 2000 EE, sp3) i get message:
> A connection could not be established to (LOCAL)
> Reason: cannot open user default database. Login faied..
> Please verify SQL Server is running and check your SQL Server
> registration properties (by right-clicking on the (LOCAL) node) and try again.
> SQL Server is running and right-clicking produces just the same message.
> Can anybody say what happend and what to do.
> Thanks a lot.|||Sorry, how can i check these if i have no access to SQL Server?
"Aleksandar Grbic" wrote:
> 1. check which database is default database for your login
> 2. default database exist on server?
> 3. check permissons on your default database
>
> "olsh" wrote:
> > Hello,
> > One day when i try to open my database om my local computer (Win 2000
> > server, SQL 2000 EE, sp3) i get message:
> > A connection could not be established to (LOCAL)
> > Reason: cannot open user default database. Login faied..
> > Please verify SQL Server is running and check your SQL Server
> > registration properties (by right-clicking on the (LOCAL) node) and try again.
> >
> > SQL Server is running and right-clicking produces just the same message.
> >
> > Can anybody say what happend and what to do.
> >
> > Thanks a lot.|||use ISQL
sample
ISQL -S<server> -U<user> -P<password>
if your default database not exist on server, isql will use master database
then, check your default database
select name,dbname from syslogins where name='<yourlogin>'
go
...
and if shall
exec sp_defaultdb 'login','database'
go
"olsh" wrote:
> Sorry, how can i check these if i have no access to SQL Server?
>
> "Aleksandar Grbic" wrote:
> > 1. check which database is default database for your login
> >
> > 2. default database exist on server?
> >
> > 3. check permissons on your default database
> >
> >
> > "olsh" wrote:
> >
> > > Hello,
> > > One day when i try to open my database om my local computer (Win 2000
> > > server, SQL 2000 EE, sp3) i get message:
> > > A connection could not be established to (LOCAL)
> > > Reason: cannot open user default database. Login faied..
> > > Please verify SQL Server is running and check your SQL Server
> > > registration properties (by right-clicking on the (LOCAL) node) and try again.
> > >
> > > SQL Server is running and right-clicking produces just the same message.
> > >
> > > Can anybody say what happend and what to do.
> > >
> > > Thanks a lot.|||Thanks, everything is OK now!!
"Aleksandar Grbic" wrote:
> use ISQL
> sample
> ISQL -S<server> -U<user> -P<password>
> if your default database not exist on server, isql will use master database
> then, check your default database
> select name,dbname from syslogins where name='<yourlogin>'
> go
> ...
> and if shall
> exec sp_defaultdb 'login','database'
> go
>
> "olsh" wrote:
> > Sorry, how can i check these if i have no access to SQL Server?
> >
> >
> > "Aleksandar Grbic" wrote:
> >
> > > 1. check which database is default database for your login
> > >
> > > 2. default database exist on server?
> > >
> > > 3. check permissons on your default database
> > >
> > >
> > > "olsh" wrote:
> > >
> > > > Hello,
> > > > One day when i try to open my database om my local computer (Win 2000
> > > > server, SQL 2000 EE, sp3) i get message:
> > > > A connection could not be established to (LOCAL)
> > > > Reason: cannot open user default database. Login faied..
> > > > Please verify SQL Server is running and check your SQL Server
> > > > registration properties (by right-clicking on the (LOCAL) node) and try again.
> > > >
> > > > SQL Server is running and right-clicking produces just the same message.
> > > >
> > > > Can anybody say what happend and what to do.
> > > >
> > > > Thanks a lot.

Connection failed to local SQL server

Hello,
One day when i try to open my database om my local computer (Win 2000
server, SQL 2000 EE, sp3) i get message:
A connection could not be established to (LOCAL)
Reason: cannot open user default database. Login faied..
Please verify SQL Server is running and check your SQL Server
registration properties (by right-clicking on the (LOCAL) node) and try again.
SQL Server is running and right-clicking produces just the same message.
Can anybody say what happend and what to do.
Thanks a lot.
1. check which database is default database for your login
2. default database exist on server?
3. check permissons on your default database
"olsh" wrote:

> Hello,
> One day when i try to open my database om my local computer (Win 2000
> server, SQL 2000 EE, sp3) i get message:
> A connection could not be established to (LOCAL)
> Reason: cannot open user default database. Login faied..
> Please verify SQL Server is running and check your SQL Server
> registration properties (by right-clicking on the (LOCAL) node) and try again.
> SQL Server is running and right-clicking produces just the same message.
> Can anybody say what happend and what to do.
> Thanks a lot.
|||Sorry, how can i check these if i have no access to SQL Server?
"Aleksandar Grbic" wrote:
[vbcol=seagreen]
> 1. check which database is default database for your login
> 2. default database exist on server?
> 3. check permissons on your default database
>
> "olsh" wrote:
|||use ISQL
sample
ISQL -S<server> -U<user> -P<password>
if your default database not exist on server, isql will use master database
then, check your default database
select name,dbname from syslogins where name='<yourlogin>'
go
...
and if shall
exec sp_defaultdb 'login','database'
go
"olsh" wrote:
[vbcol=seagreen]
> Sorry, how can i check these if i have no access to SQL Server?
>
> "Aleksandar Grbic" wrote:
|||Thanks, everything is OK now!!
"Aleksandar Grbic" wrote:
[vbcol=seagreen]
> use ISQL
> sample
> ISQL -S<server> -U<user> -P<password>
> if your default database not exist on server, isql will use master database
> then, check your default database
> select name,dbname from syslogins where name='<yourlogin>'
> go
> ...
> and if shall
> exec sp_defaultdb 'login','database'
> go
>
> "olsh" wrote:

Connection failed to local SQL server

Hello,
One day when i try to open my database om my local computer (Win 2000
server, SQL 2000 EE, sp3) i get message:
A connection could not be established to (LOCAL)
Reason: cannot open user default database. Login faied..
Please verify SQL Server is running and check your SQL Server
registration properties (by right-clicking on the (LOCAL) node) and try agai
n.
SQL Server is running and right-clicking produces just the same message.
Can anybody say what happend and what to do.
Thanks a lot.1. check which database is default database for your login
2. default database exist on server?
3. check permissons on your default database
"olsh" wrote:

> Hello,
> One day when i try to open my database om my local computer (Win 2000
> server, SQL 2000 EE, sp3) i get message:
> A connection could not be established to (LOCAL)
> Reason: cannot open user default database. Login faied..
> Please verify SQL Server is running and check your SQL Server
> registration properties (by right-clicking on the (LOCAL) node) and try ag
ain.
> SQL Server is running and right-clicking produces just the same message.
> Can anybody say what happend and what to do.
> Thanks a lot.|||Sorry, how can i check these if i have no access to SQL Server?
"Aleksandar Grbic" wrote:
[vbcol=seagreen]
> 1. check which database is default database for your login
> 2. default database exist on server?
> 3. check permissons on your default database
>
> "olsh" wrote:
>|||use ISQL
sample
ISQL -S<server> -U<user> -P<password>
if your default database not exist on server, isql will use master database
then, check your default database
select name,dbname from syslogins where name='<yourlogin>'
go
...
and if shall
exec sp_defaultdb 'login','database'
go
"olsh" wrote:
[vbcol=seagreen]
> Sorry, how can i check these if i have no access to SQL Server?
>
> "Aleksandar Grbic" wrote:
>|||Thanks, everything is OK now!!
"Aleksandar Grbic" wrote:
[vbcol=seagreen]
> use ISQL
> sample
> ISQL -S<server> -U<user> -P<password>
> if your default database not exist on server, isql will use master databas
e
> then, check your default database
> select name,dbname from syslogins where name='<yourlogin>'
> go
> ...
> and if shall
> exec sp_defaultdb 'login','database'
> go
>
> "olsh" wrote:
>