|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
HELP Cant get connection to my server with SQLDMOservers. I grabbed a demo program from: http://www.csharphelp.com/archives2/archive342.html called SQLDMO for C# from Kevin Goss I built the program successfully in VS 2003 and it shows me a list of servers (mine being on the list) but when I try and connect to it using the interface I get the following messages: --------------------------- Error --------------------------- [Microsoft][SQL Native Client][SQL Server]Login failed for user 'CODE1\smoody'. Reason: Not associated with a trusted SQL Server connection. [Microsoft][SQL Native Client]Shared Memory Provider: The system cannot open the file. [Microsoft][SQL Native Client]Communication link failure --------------------------- OK --------------------------- The code where this is occurring is: (I didnt want to include the whole program and I wasnt sure how much was needed for diagnosing the problem) I can send more of the code if needs be, just tell me how much you think you need. SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass(); srv.Connect(this.cboServers.SelectedItem.ToString(),this.txtUser.Text,this.txtPassword.Text); I have confirmed that the user has access to the database as well as setting up a DSN entry to access the database. But as of yet I still can not get past the errors... Please HELP!!!!! Thanks -Steve Steve,
Ensure the SQL Server is running in Mixed Mode Authentition instead of Windows Authentication only or change your connection string to use Windows credentials. HTH Jerry Show quote "SteveM" <steve.mo***@philips.com> wrote in message news:1129926133.227261.243290@g47g2000cwa.googlegroups.com... >I am trying to learn SQLDMO for working with our SQL Server 2000 > servers. I grabbed a demo program from: > http://www.csharphelp.com/archives2/archive342.html > called SQLDMO for C# from Kevin Goss > > I built the program successfully in VS 2003 > and it shows me a list of servers (mine being on the list) > but when I try and connect to it using the interface I get the > following messages: > > --------------------------- > Error > --------------------------- > [Microsoft][SQL Native Client][SQL Server]Login failed for user > 'CODE1\smoody'. Reason: Not associated with a trusted SQL Server > connection. > [Microsoft][SQL Native Client]Shared Memory Provider: The system cannot > open the file. > > > [Microsoft][SQL Native Client]Communication link failure > --------------------------- > OK > --------------------------- > > > > > The code where this is occurring is: (I didnt want to include the whole > program and I wasnt sure how much was needed for diagnosing the > problem) I can send more of the code if needs be, just tell me how much > you think you need. > > > SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass(); > srv.Connect(this.cboServers.SelectedItem.ToString(),this.txtUser.Text,this.txtPassword.Text); > > > I have confirmed that the user has access to the database as well as > setting up a DSN entry to access the database. But as of yet I still > can not get past the errors... Please HELP!!!!! > > Thanks > -Steve > I checked and indeed I was NOT running in mixed mode. I changed this and
will check to see if that was the problem. I think I may have found a better way to do things however. A co-worker of mine showed me a property called srv.LoginSecure = true; This uses my windows credentials without my having to record my userid and password (even though I know I can encrypt it in a config file in the project). This seems a better way to go, but I do want to learn to do things the other way, so you advice will be very helpful. Thanks for taking the time to respond I appreciate it -Steve *** Sent via Developersdex http://www.developersdex.com ***
Other interesting topics
|
|||||||||||||||||||||||