views:

379

answers:

2

I have to get the data from a User site. If I would work on their site, I would VPN and then remote into their server using username and password.

I thought getting data into my local machine than getting into their server where my work is not secured.

So, I thought of using Ironpython to get data from the remote server. So, I still VPN'd to their domain, but when I was using the ADO.net connection string to connect to their database, it does not work.

connection string: Data Source=xx.xx.xx.xx;Initial Catalog=;User ID=;Password=;

and the error says: login failed for

Well, one thing to notice is: when i remote into their server, I provide username and password once. Then when i log on to SQL Server, I dont have to provide username and password. It s windows authenticated. So, in the above connection string, I used the same username and password that I use while remoting in. I hope this gives an idea to ya'll what i might be missing.

Help appreciated!!!

A: 

Data Source=xx.xx.xx.xx;Initial Catalog=;Integrated Security="SSPI"

How are you connecting to SQL. Do you use sql server authentication or windows authentication? Once you know that, then if you use a DNS name or IP that will go to the server correctly, you have the instance name correct AND you have permissions on the account to access the server you can connect.

Heres a quick test. From the system you are using to connect to your SQL Server with, can you open the SQL Server management studio and connect to the remote database. If you can, tell me what settings you needed to do that, and I'll give you a connection string that will work.

Spence
error: login failed for user ''. the user is not associated with a trusted sql sever connection.
Sagar
well then your logged in user doesn't have a log in authority to the database your selecting. You'll need to consult with the DBA to get your user access.
Spence
i dont think it s possible because i can access to the server using remote desktop connection and to the Sql server using windows authentication. And I assume that windows authentication takes the credentials of the logged in user, which happens to be the username and password i provide for remote desktop connection.
Sagar
No. SQL Server has its own authentication store, which can leverage the active directory. However regardless of whether a user can log into the SQL Server's operating system, this doesn't give you access to the box. you have to explicitly add the user and then place them in the schemas that they need access to. Trust me, I've been in exactly the spot you're in now and this is definately whats going wrong. And I had exactly your thought process as to why can I log into the box but not the database even though I'm admin.
Spence
oh! i see what u r saying...but my point is: if I can remote into the server using a certain username and password and can also access the sql server with the credential that is windows authenticated, and also can access any database, then why should I be checking the user's status.....should not I be checking if the sql server is set for remote connection (well it is in my case) or any relevant stuffs?
Sagar
thas they reason why I am asking: if i can access the server using VPN and remote desktop connection, what would be the appropriate connection string in ADO.net so that I can pull data programmatically?
Sagar
A: 

Is that user granted login abilities in SQL?

If using SQL 2005, you go to Security->Logins

Double click the user, and click Status.

------Edit ----

Create a file on your desktop called TEST.UDL. Double click it.

setup your connection until it works.

View the UDL in notepad, there's your connection string. Though I think you take out the first part which includes provider info.

Jack Marchetti
permission:granted and login:enabled
Sagar