I always got failed to "fetching of list failed error".
This is my connection string in ASP.NET
"Data Source=maywood\XSQLSERVER;Initial Catalog=maywood_test;Integrated Security=SSPI"
What exactly should I input at MySQL migration tool for source parameter string
FYI,'maywood' is my computer name and I am using SQL Server 2000.
You have integrated Integrated Security=SSPI set -- perhaps you should try setting the UID and Password manually to values that you know are correct.
Data Source=maywood\XSQLSERVER;Initial Catalog=maywood_test;
User ID=myUsername;Password=myPassword;
Integrated Security uses the credentials from the Windows system that you're using to log in -- these credentials might not be valid for the database you're trying to access.
Related
I had a database server for school and since the semester is over I no longer am on this server. I want to take all my projects and put them on my website I've been working on. The problem is they have the school server connection. On the back end when I want to open a connection to my local database how would I do this? My connection looks like this
SqlConnection con = new SqlConnection("Data Source=LocalServerName;");
I get an error about the user, but my username for my local connection has a \ in it and that's an invalid key so I can't put my username in
Try this....
string connectionString = "Integrated Security=SSPI;Initial Catalog=master;Data Source=(local)"
SqlConnection con = new SqlConnection(connectionString);
You can change the value for Initial Catalog from "master" to the name of your database. I'm assuming you're using integrated security (you login to SQL Server with your Windows account).
If your login failed, look in SQL Server's error log for a failed login attempt. The error will give you more details about why the login attempt failed.
If you're logging in using a domain account - a.k.a., Windows authentication, a.k.a., Integrated Security - you'll include the following in your connection string:
Integrated Security=SSPI;
If you are connecting with a SQL Server username (username and password maintained by SQL Server and NOT by Windows or Active Directory). You'll use the following:
Persist Security Info=True;User ID=<username>;Password=<password>;
If you're not 100% sure how to create your connection string, try this trick:
Create a text file on your desktop named "test.udl"
Once created, double click on that file.
You can set all the properties of your connection string here.
When you're done, hit OK.
Then open the file in a text editor (e.g., notepad).
You'll see a connection string configured with the options you previously set. Copy and paste.
I use Microsoft Visual Studio Professional 2013. I created Database1.mdf in my App_Data folder. By default, it uses integrated Windows authentication. I have no problem connect to this database file, but when I update all file into web space and browse it in browser, it has an error. I think I need to change it to SQL Server authentication instead of integrated Windows authentication.
My questions are:
How can I change it to SQL Server authentication step by step? I want to connect this data file with user name & password.
How to assign user into it?
You need to attach the database file to your SQL Server:
http://www.youtube.com/watch?v=rhIr9Qf-oHw
Then you create the type of logins you want:
http://www.youtube.com/watch?v=Uh5USR7pymE
You can now detach the database. Your application can use now the new logins. If you change from Windows to User/password your connection will need to say so, something like:
Server=myServerAddress;Database=myDataBase;User Id=myUsername;
Password=myPassword;
I also found this helpful link that describes also the steps:
SQLExpress - How do I set username/password for a sql datafile
Hope this helps.
I'm using this connection string to connect to a ms sql server '08 db,
"Data Source=qwe;Initial Catalog=dsa;Integrated Security=SSPI;User Id=mydom\unamee;Password=pwd;"
but the server is ignoring the username i specify and uses my machine name instead; and says that it is unable to authenticate user mydom\myMachineName
I've check the other similar question, but that is not the same as this problem, someone please help, my head is breaking
When you use Integrated Security=SSPI (or true), UserID and password you have specified are ignored. Login will be made using the windows credentials you are logged in Windows\domain. In that case you'll need to have an appropriate windows login created in SQL Server.
If you want to use SQL Server login, specifying username and password created in SQL Server -you should set 'Integrated Security=false or remove that property altogether because false is default value.
EDIT:
To make a long story short: You can either use Integrated security or username/password and not both. You can not log in using someone else's domain account, only of user logged in Windows at the moment.
In order to use a domain account to connect to Sql Server you have to be logged with that account, Integrated Security=SSPI; pass to SQL the current domain credentials,User Id and Password values in connection string are used to send SQL Server user (not domain user) and password to connect to it, but in this case your Sql Server has to be set in mixed mode security to allow this kind of credentials. Sorry about my english, I hope this was useful for you. Regards
I have a Visual Studio C++ project (unmanaged C++) in which I try to connect to a SQL Server 2008 instance on another machine in the LAN. I use TCP/IP. My connection string is:
"DRIVER={SQL Server Native Client 10.0};Server=tcp:169.254.204.232,1433;Network Library=DBMSSOCN;Initial Catalog=myDB;User ID=myDBUser;Password=myPassword;"
Important fact: I am able to successfully connect remotely to that instance with user id myDBUser and password myPassword using SSMS -- using SQL Authentication mode (and specifying TCP/IP in the connection options)! Also, once logged in I can successfully navigate the database myDB.
So yes, I have enabled Mixed mode authentication on my server.
Also note that the same code was successfully connecting when my instance was local and I was using Windows Authentication. In other words, what changed since this whole thing last worked is that I moved my server to another machine, am now using SQL Authentication, and therefore changed my connection string -- the code has otherwise not changed at all.
Here is the error message I get in my SQL Server 2008 instance's Server Logs:
Login failed for user ". Reason: An attempt to login using SQL Authentication failed. Server is configured for Windows Authentication only.
Error: 18456, Severity: 14, State: 58.
Notice that the user being quoted in that error message is blank, even though in my connection string I specify a non-blank user ID.
Other connection strings I tried that give the same result:
"DRIVER={SQL Server Native Client 10.0};Server=MACHINE2;Database=myDB;User ID=myDBUser;Password=myPassword;" (where MACHINE2 is the windows name of the machine hosting the sql server instance.)
I do not specify an instance name in the above connection string because my instance is installed as the default instance, not a named instance.
Any ideas on how to solve this?
UPDATE: I solved this problem it seems. Are you ready to find out how silly and totally unrelated that error message was?
In the connection string, I just changed "User ID" to "uid" and "Password" to "pwd", and now it works.
I now see "Connected successfully" in my SQL Server logs...
Try running SELECT SERVERPROPERTY('IsIntegratedSecurityOnly'); if it returns 1 is Windows Authentication if 0 Mixed. If it returns 1 is definitely Windows Authentication and there must be something else wrong.
I think I solved this problem by doing this...
right click on servername on object explorer -> Properties -> Security -> Changed server authentication to SQL server and Windows authentication mode -> click OK.
after that open server on object explorer -> Expand security -> Expand Login -> right click on your login -> properties -> type new password -> confirm password -> OK.
then disconnect your SQL and restart your system. then login SQL server 2008 with changed password in sql authentication mode.
Thanks :)
The answer: In the connection string, I just changed "User ID" to "uid" and "Password" to "pwd", and now it works. I now see "Connected successfully" in my SQL Server logs...
I have a SQL server 2000 and an Access database mdb connected by Linked server on the other hand I have a program in c # that updates data in a SQL table (Users) based data base access.
When running my program returns the following error message:
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. Authentication failed.
[OLE / DB provider returned message: Can not start the application. Missing information file of the working group or is opened exclusively by another user.] OLE DB error trace [OLE / DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize:: Initialize returned 0x80040E4D: Authentication failed.]ยด .
Both the program, the sql server and database access are on a remote server.
On the local server the problem was solved by running the following:
"sp_addlinkedsrvlogin 'ActSC', 'false', NULL, 'admin', NULL".
Try on the remote server the next, without result:
"sp_addlinkedsrvlogin 'ActSC', true, null, 'user', 'pass'".
On the remote server and from the "Query Analyzer" sql update statements are working correctly.
Can you think of what may be the problem?
Thanks!
You can't access mdw file remotely? Specify remote mdw file location in provider string (Jet OLEDB:System Database=MySystem.mdw) and allow access to it from local server.
My guess is that this is related to user impersonation. Simply said: when you use Query Analyser you're using a different login than when you're accessing the server from your C# application. Try by setting the same username & password in your C# app.
You could solve this by configuring the linked server connection with a username and password, so that SQL server disregards any other password/current user credentials. Just use/check the last option/radio in this printscreen (disregard the login mappings list in the middle) and enter the username & password to use for ALL connections:
(source: msdn.com)