Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Thursday, March 29, 2012

cant connect

i am devleoping an ASP.Net website now. i got a problem on connecting. when i try to connect (i manually made thew connection), it wont connect. the error is this:

System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'MANEC\Batman'.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

I have other other webpage that uses sqlconenction. they connect fine but they are not manually created. i created their connection through the sqldatasource wizard. i am testing these pages using the built-in server of VWD-Express but when you test it on IIS it gets an error (this is my 2nd problem). i am totally confused.

i am thinking there is something missing in the connection that i manually created. I put the settings in the "web.config" file but it did no good.

can you give me instruction on how to properly connect from Web? PLS? i have no problem connecting when i am creating desktop applications (using C# & SQLExpress).

PLS HELP. pls.

Seems that the user has an orphaned database assigned to, try to set the deault database of the user to a valid one.

sp_defaultdb

Changes the default database for a Microsoft SQL Server login.

More information in the BOL.


HTH; jens Suessmeyer.

|||

thanks for the reply. i have solved this issue by setting sql authentication to mixed mode and assigned a username/password on the connection string. it connects now.

i can see that the connection is ok but when i am attemting to create a new table to the ASPNETDB.mdf, i get this error message:

System.Data.SqlClient.SqlException: Unable to open the physical file "D:\myDocs\Visual Studio 2005\WebSites\techPad\App_Data\ASPNETDB.MDF". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
Unable to open the physical file "D:\myDocs\Visual Studio 2005\WebSites\techPad\App_Data\ASPNETDB_log.ldf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
Cannot open user default database. Login failed.
Login failed for user 'xxx'.
File activation failure. The physical file name "D:\myDocs\Visual Studio 2005\WebSites\techPad\App_Data\ASPNETDB_log.ldf" may be incorrect.at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

PLS HELP.

|||OK, strange thing. Seems that you connected with the attachdbfile option a database, but connect with another connection to the sql server express attached database or vice versa. But you have to decide wheter you want to use the service of the direct attachdbfile way.

HTH, jens Suessmeyer.|||

Jens Suessmeyer wrote:

OK, strange thing. Seems that you connected with the attachdbfile option a database, but connect with another connection to the sql server express attached database or vice versa. But you have to decide wheter you want to use the service of the direct attachdbfile way.

HTH, jens Suessmeyer.

you are right. i attached ASPNETDB.net using attachdbfile. that is set on the web.config file.

|||

somehow i have resolved this issue but the problem keeps on coming after another.

from the suggestion of the people from www.asp.net ( http://forums.asp.net/1/904462/ShowPost.aspx#904462 ) here is what i got now:

error after disabling "Write" capability from ACL:
System.Data.SqlClient.SqlException: Failed to update database "C:\INETPUB\WWWROOT\TECHPAD\APP_DATA\ASPNETDB.MDF" because the database is read-only. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

error after ENABLING "Write" capability from ACL:
System.Data.SqlClient.SqlException: Cannot open user default database. Login failed. Login failed for user 'MANEC\ASPNET'. at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

this makes me think its so hard to study VWD and SQLExpress for a newbie like me. when I run the webpages from the built-in webserver of VWD it may work fine but when on IIS it will not work (or vice-versa). so confusing. maybe bcoz im very new to this.

i find it hard to do all of these setups. i wanna learn this though. PLS HELP.

|||i posted the same issue to the other page here. pls help. pls check this out > http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=68698&SiteID=1&PageID=1

can't conect remotely to SQL Express

I am connecting remotely to SQL Express using my VB application. Here is the
connection string that I use.
cn.ConnectionString = "Provider=SQLNCLI;Network Library=DBMSSOCN;Integrated
Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
"database=CopyRequest"
I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
connect. What is the cause of this error? I allow remote connections on SQL
Server.Hi
Have you checked the permissions for 'ILYA-TEST-PC\Guest' ?
John
"Ilya" wrote:

> I am connecting remotely to SQL Express using my VB application. Here is t
he
> connection string that I use.
> cn.ConnectionString = "Provider=SQLNCLI;Network Library=DBMSSOCN;Integrate
d
> Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
> "database=CopyRequest"
> I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
> connect. What is the cause of this error? I allow remote connections on SQ
L
> Server.|||Guest is disabled by default. I assume you're not logged in as guest when
you try to make the connection so this error means you are connecting as a
Windows user who doesn't have permissions or can't be authenticated to the
local Windows machine. Get Windows security working and I think it will
work.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ilya" <Ilya@.discussions.microsoft.com> wrote in message
news:6CAFF2A5-3273-4E28-AFEB-07060DFFE503@.microsoft.com...
>I am connecting remotely to SQL Express using my VB application. Here is
>the
> connection string that I use.
> cn.ConnectionString = "Provider=SQLNCLI;Network
> Library=DBMSSOCN;Integrated
> Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
> "database=CopyRequest"
> I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
> connect. What is the cause of this error? I allow remote connections on
> SQL
> Server.

can't conect remotely to SQL Express

I am connecting remotely to SQL Express using my VB application. Here is the
connection string that I use.
cn.ConnectionString = "Provider=SQLNCLI;Network Library=DBMSSOCN;Integrated
Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,14 33;" & _
"database=CopyRequest"
I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
connect. What is the cause of this error? I allow remote connections on SQL
Server.
Hi
Have you checked the permissions for 'ILYA-TEST-PC\Guest' ?
John
"Ilya" wrote:

> I am connecting remotely to SQL Express using my VB application. Here is the
> connection string that I use.
> cn.ConnectionString = "Provider=SQLNCLI;Network Library=DBMSSOCN;Integrated
> Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,14 33;" & _
> "database=CopyRequest"
> I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
> connect. What is the cause of this error? I allow remote connections on SQL
> Server.
|||Guest is disabled by default. I assume you're not logged in as guest when
you try to make the connection so this error means you are connecting as a
Windows user who doesn't have permissions or can't be authenticated to the
local Windows machine. Get Windows security working and I think it will
work.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ilya" <Ilya@.discussions.microsoft.com> wrote in message
news:6CAFF2A5-3273-4E28-AFEB-07060DFFE503@.microsoft.com...
>I am connecting remotely to SQL Express using my VB application. Here is
>the
> connection string that I use.
> cn.ConnectionString = "Provider=SQLNCLI;Network
> Library=DBMSSOCN;Integrated
> Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,14 33;" & _
> "database=CopyRequest"
> I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
> connect. What is the cause of this error? I allow remote connections on
> SQL
> Server.

can't conect remotely to SQL Express

I am connecting remotely to SQL Express using my VB application. Here is the
connection string that I use.
cn.ConnectionString = "Provider=SQLNCLI;Network Library=DBMSSOCN;Integrated
Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
"database=CopyRequest"
I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
connect. What is the cause of this error? I allow remote connections on SQL
Server.Hi
Have you checked the permissions for 'ILYA-TEST-PC\Guest' ?
John
"Ilya" wrote:
> I am connecting remotely to SQL Express using my VB application. Here is the
> connection string that I use.
> cn.ConnectionString = "Provider=SQLNCLI;Network Library=DBMSSOCN;Integrated
> Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
> "database=CopyRequest"
> I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
> connect. What is the cause of this error? I allow remote connections on SQL
> Server.|||Guest is disabled by default. I assume you're not logged in as guest when
you try to make the connection so this error means you are connecting as a
Windows user who doesn't have permissions or can't be authenticated to the
local Windows machine. Get Windows security working and I think it will
work.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ilya" <Ilya@.discussions.microsoft.com> wrote in message
news:6CAFF2A5-3273-4E28-AFEB-07060DFFE503@.microsoft.com...
>I am connecting remotely to SQL Express using my VB application. Here is
>the
> connection string that I use.
> cn.ConnectionString = "Provider=SQLNCLI;Network
> Library=DBMSSOCN;Integrated
> Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
> "database=CopyRequest"
> I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
> connect. What is the cause of this error? I allow remote connections on
> SQL
> Server.

Tuesday, March 20, 2012

can't access server

Hi, I'm having problem with a workstation connecting to the Server's SQL
Server. The workstation can access the server's hard drive via share and
TCP/IP seems to be working. But the workstation just can't access the
server.
how to tack it down? Thanks.
Hi
What is the error message?
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"js" <js@.someone.com> wrote in message
news:uzlVHEDLFHA.3628@.TK2MSFTNGP10.phx.gbl...
> Hi, I'm having problem with a workstation connecting to the Server's SQL
> Server. The workstation can access the server's hard drive via share and
> TCP/IP seems to be working. But the workstation just can't access the
> server.
> how to tack it down? Thanks.
>
|||Thanks Mike,
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:eD0%23SeHLFHA.2716@.TK2MSFTNGP15.phx.gbl...
> Hi
> What is the error message?
Error: SQL server does not exist or access denied.
It works local, but not trying to connect from another computer.
And I found there are two instance of sql server.
how to check it out? thanks.
sql

can't access server

Hi, I'm having problem with a workstation connecting to the Server's SQL
Server. The workstation can access the server's hard drive via share and
TCP/IP seems to be working. But the workstation just can't access the
server.
how to tack it down? Thanks.Hi
What is the error message?
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"js" <js@.someone.com> wrote in message
news:uzlVHEDLFHA.3628@.TK2MSFTNGP10.phx.gbl...
> Hi, I'm having problem with a workstation connecting to the Server's SQL
> Server. The workstation can access the server's hard drive via share and
> TCP/IP seems to be working. But the workstation just can't access the
> server.
> how to tack it down? Thanks.
>|||Thanks Mike,
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:eD0%23SeHLFHA.2716@.TK2MSFTNGP15.phx.gbl...
> Hi
> What is the error message?
Error: SQL server does not exist or access denied.
It works local, but not trying to connect from another computer.
And I found there are two instance of sql server.
how to check it out? thanks.

Sunday, March 11, 2012

Cannot use the special principal 'sa'

Hello,

I am starting to use SQL Server 2005. I am having trouble connecting remotely. I tried to enable the 'sa' user and got this error:

Cannot use the special principal 'sa'

Is the 'sa' user no longer valid for remote connections?

Thank you

Did you enable "Mixed Mode" authentication? If you use Windows authentication, sa is disabled by default.

Sung

|||

How did you try to "enable" sa? What statement did you execute to get that error?

Thanks
Laurentiu

|||

Thank you for your reply.

Yes, I did enable Windows authentication, but when I could not connect remotely I decided to to try and connect using SQL authentication. Can I change the authentication mode?

Thank you

|||

Yes, you can change the authentication mode: go to Management Studio and open Object Explorer. Connect to your server and right-click on the server name, then select Properties. Go to Security tab and under Server Authentication select SQL Server and Windows Authentication Mode.

Thanks
Laurentiu

|||

Also, after you follow the directions above, you will also need to explicitly enable the sa account as well. In the same place as before, go to Security->Logins. Right-click on the "sa" account, select "Properties". In the list on the left, select "Status" and under "Login" on the right, make sure "Enable" is selected.

[edit] - nevermind, looks like you got it working :)

Sung

|||

I found the steps to change the authentication.

Now I can login remotely.

Thank you

Friday, February 10, 2012

Cannot re-read data in column 2

Hi,

I'm connecting to my SQL Server via Java in my Notes environment, but when I try to update my Notes-documents I get an error fra SQL Server saying that it can not re-read data from column 2.

Without being absolutely certain - I'm quite sure that the code is valid.

Does anyone know what the error means ?

Thanks in advance

Kim HansenHi,

I'm connecting to my SQL Server via Java in my Notes environment, but when I try to update my Notes-documents I get an error fra SQL Server saying that it can not re-read data from column 2.

Without being absolutely certain - I'm quite sure that the code is valid.

Does anyone know what the error means ?

Thanks in advance

Kim Hansen

there is this KB on this error:
http://support.microsoft.com/default.aspx?kbid=824106