473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Can't Connect to SQL db

Going a bit crazy. Have sqlserver all installed and running. I have a
security problem I think- have read many other news posts that SOUND
similar but e.g. My SQL Server configuration manager doesnt seem to
have seccurity options let alone offer the possibility of allowing a
'mix' of SQL/ windows requests.

For logon in SQL Server configuration manager 'built- in account'
local system is selected rather than the 'this account' option which
has stars in the password field and no username options.

This is myconnection string: kris\ is this local machine

myConnection = New SqlConnection("server=kris
\SQLEXPRESS;uid=sa;pwd=;database=pubs")

This is the error I get
System.Data.SqlClient.SqlException was unhandled
Class=14
ErrorCode=-2146232060
LineNumber=65536
Message="Login failed for user 'sa'. The user is not associated with
a trusted SQL Server connection."
Number=18452
Procedure=""
Server="kris\SQLEXPRESS"

Any ideas?

Feb 13 '07 #1
4 9379
DanWeaver (da*********@googlemail.com) writes:
This is myconnection string: kris\ is this local machine

myConnection = New SqlConnection("server=kris
\SQLEXPRESS;uid=sa;pwd=;database=pubs")

This is the error I get
System.Data.SqlClient.SqlException was unhandled
Class=14
ErrorCode=-2146232060
LineNumber=65536
Message="Login failed for user 'sa'. The user is not associated with
a trusted SQL Server connection."
Number=18452
Procedure=""
Server="kris\SQLEXPRESS"
Have you enabled you server for SQL authetnication? By default,
SQL Server permits only Window authentication.

Do you have any particular reason you want to use SQL authentication?
Else, change "uid=sa;pwd=" to "Integrated Security=SSPI".
For logon in SQL Server configuration manager 'built- in account'
local system is selected rather than the 'this account' option which
has stars in the password field and no username options.
Note that his is about how SQL Server logs into Windows. That's a
different thing.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 13 '07 #2
Do you have any particular reason you want to use SQL authentication?
Else, change "uid=sa;pwd=" to "Integrated Security=SSPI".
Thanks, Erland. That helped move me on- in fact the first time I tried
it it seemed to work (though my record was not added- posibly as there
already existed a record with same id) Anyway- I cant experiment with
that cos shorlty after I could no longer connect- seems strange- I
checked the table after first successful run to see if it had updated
and ran the code again- got a message "another process is locking the
db"- great I thought- all is working- and closed the connection in
VS-
now though the connection gets stuck at login and says:

Cannot open database "pubs" requested by the login. The login failed.
Login failed for user 'KRISLAPTOP\Kris'.


Feb 14 '07 #3
DanWeaver (da*********@googlemail.com) writes:
>Do you have any particular reason you want to use SQL authentication?
Else, change "uid=sa;pwd=" to "Integrated Security=SSPI".

Thanks, Erland. That helped move me on- in fact the first time I tried
it it seemed to work (though my record was not added- posibly as there
already existed a record with same id) Anyway- I cant experiment with
that cos shorlty after I could no longer connect- seems strange- I
checked the table after first successful run to see if it had updated
and ran the code again- got a message "another process is locking the
db"- great I thought- all is working- and closed the connection in
VS-
now though the connection gets stuck at login and says:

Cannot open database "pubs" requested by the login. The login failed.
Login failed for user 'KRISLAPTOP\Kris'.
Seems like that either your user is not present in the pubs database,
or the database has somehow gone away.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 14 '07 #4
Thanks, Erland. Something fishy was ocurring with the dbs- deleted
them and reconnected and set permissions again- seems to work now.

Cheers, more challenging questions (when I am more informed!) will
probably follow.

Dan
Seems like that either your user is not present in the pubs database,
or the database has somehow gone away.

--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Feb 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ryan Stewart | last post by:
I'm running MySQL server on a WinXP box at home. I have a cable modem/router. I've set up port forwarding on port 3306 to the machine running MySQL. I can connect locally just fine, but when I try...
3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
5
by: Kona | last post by:
Hello, Is it right to tell that DB2 Connect has the same function that Oracle Net ? If I have an ODBC application is it also right to tell that I have 2 possibilities on my client workstation to...
30
by: aka | last post by:
Hi I have a DB2 v8.1 on AIX and DB2 Connect EE on Solaris wich is connected to OS/390 DB2 subsystems via APPC / SNA. I have cataloged the DB2 Connect instance as tcpip node and then the Host DB...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
14
by: DaTurk | last post by:
I am makeing a Multicast server client setup and was wondering what the difference is between Socket.Connect, and Socket.Bind. It may be a stupid question, but I was just curious. Because I...
0
by: Clodoaldo Pinto | last post by:
Can't connect to postgresql server php error log message: PHP Warning: pg_connect() : Unable to connect to PostgreSQL server: could not connect to server: Permission denied\n\tIs the server...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
3
by: blackpuppy | last post by:
I am just beginner on PHP. I am reading "Spring Into PHP 5" but cannot make the ftp examples work. I am running PHP scripts on a Fedora Core 5 (VMWare virtual machine) on top of a Windows XP...
4
by: d3vkit | last post by:
Okay so I am at a loss here. I have a website that I've previously had no trouble connecting to the mysql DB on. I have an include to a connect file with the relevant connection info, and it was...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.