Showing posts with label googled. Show all posts
Showing posts with label googled. Show all posts

Wednesday, March 21, 2012

remote sql server login fails

Hello,

I'm about googled out on this one. I did find one post that looked almost like mine but the thread was never finished. I'm sure this problem has been solved and I'm just having trouble finding it. Can someone help me?

I'm running sql server 2000 on a small workgroup network of winxp machines.

If sql server machine is the same as webserver machine, my asp.net app works. If sql server and webserver are different, the app fails because of sql server login failure.

I am able to explore the database remotely through server explorer in VStudio2003. However, when I try to access the database with the asp.net application, the login fails. I have tried several connection strings. Authentication on the server is 'mixed', the server runs in the system account, and the password for sa is "" (blank password).

I've tried (for instance)
Application["DBConnectString"] = "server=machinename;uid=sa;pwd=;database=Resume";
and
Application["DBConnectString"] = "server=machinename;integrated security=true;database=Resume";

When "machinename" is the same as the machine on which the app is running. both of those connection strings work, and the application runs correctly.

When "machinename" is different (that is, sql server on a different machine from the webserver), depending on the connection string I get either
"Login failed for user 'sa'."
or
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."

Obviously VStudio is using some mechanism to add the remote server to it's list of servers and then to allow me manually to explore the databases on that server. Why am I too stoopid to figure it out?

TIA,
Timuse the IP.

or go to www.able-consulting.com, and click on technology and look up how to use connection strings.|||I'm sorry but your reply doesn't make any sense to me. I did try using the IP address and got the same errors. Was your suggestion that I should learn how to use connection strings meant to be sarcastic?

Maybe someone who knows the answer will post.|||no I wasn't being sarcastic. that site is my main resource for connection strings.

also, it's not uid, it's user id. :) my bad. can't believe I missed that. and pwd is password.|||Well, like I said in the original post, the connection strings both work just fine when the sql server and web server are the same, so I don't understand what you meant about learning about connection strings.

Maybe someone who knows the answer will post...|||I've managed to solve half the problem. Apparently the remote server will not allow sa to login over the network when the password for sa is "". I changed it to a non-blank password and now the following works:
Application["DBConnectString"] = "server=machinename;uid=sa;pwd=password;database=Resume";

Please forgive me for having a blank sa password. The workgroup is behind a firewall and the only substantial databases are northwind and pubs, so I figured I was safe. :-P

So, I guess I am more curious than desperate now. I would really rather get the integrated security form of the connection string to work, because I don't like the idea of hard coding passwords into the connection strings. Is integrated security possible in a workgroup setting?

TIA,
Tim|||You should be able to use integrated security.

Your connection string should look like this: "Server=machinename;Database=Resume;Trusted_Connection=True;"

Presumably you are receiving this error with that connection string:
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."

This means that the Microsoft Windows user account that IIS uses to process the request for the web page does not have a corresponding NT Authentication login in the remote SQL Server. Read up on this issue here:PRB: ASP/ODBC/SQL Server Error 0x80040E4D "Login Failed for User '(Null)'". Be sure to read theAuthentication methods for connections to SQL Server in Active Server Pages andINFO: Accessing SQL Server with Integrated Security from ASP links as well.

Terri|||Thank you for thinking about this. I agree with you: I should be able to use integrated security. I'm beginning to think integrated security is a little bit of a fudge with workgroups, however, and that may be my problem.

I had run across those KB articles before but re-read them at your suggestion. I have tried some of the recommendations without success. Some seem out of date, though. Also, the warning that I got in response to the workaround in KB 176379 against using it was so explicitly scary that I undid the change before I even tested it.

Another KB article mentioned a change that would result in the user being required to login when accessing the remote page. I don't think that is a good idea, especially if it happens every time I want to open/re-open a connection to the database, but it shouldn't be necessary at all, since the user is already logged in to Windows and that's what the idea of integrated security is about, right?

I suspect the problem is related to the fact that the network is a workgroup, with no domain controller to authenticate the user in a totally acceptable way. In my situation, for instance, file sharing works between machines as long as the user is defined on all machines with the same name and password, but I have noticed I'm not able to access my own data in the "Documents and Settings" folder of a machine across the network, even though the drive is shared and I have access to other files on the drive and I'm logged in as the same user as the owner of that folder on that machine. Perhaps SQL and/or IIS are having similar glitches.

What I find particularly exasperating is that, without making any changes to any of the servers' settings, VStudio is able to have its way with the databases on the remote machine, via the Studio Server Explorer. Obviously there is some mechanism by which it is sending my credentials, or someone's credentials. I'm just not seeing the secret incantation in any of the info I've looked at so far.

If you have ever gotten this to work for yourself, and as I said I think the problem is to do with the fact that it's a workgroup although I'd be happy to be proved wrong in that regard as long as I get it working eventually, I'd really like to see specifically the solution. And again, it's a WinXP (Pro) workgroup. Some of the KB articles refer to problems with NT4 that were fixed in Win2000. Not clear whether WinXP "improvements" to Win2000 may have made it easier or harder to do what I want to do.

Thanks again for your suggestions.

Wednesday, March 7, 2012

Remote Debugging Problems w/ VS.net 2005 SP1

I have done through all the MSDN documentation and Googled everything I could
on the errors I am receiving about installing and configuring remote
debugging. I believe it is communications related. This is the scenario:
The Visual Studio 2005 Remote Debugger service is started on the remote
database server that I want to debug SQL code on as Local System. I am a
member of the local administrators group on that server and a member of the
sa role in SQL Server. I configured all the DCOM settings on both the remote
server and my local workstation, which is running XP SP2, and opened the
firewall exceptions on my workstation.
When I attempt to step into a procedure, the message " Unable to start T-SQL
Debugging. Could not attach to SQL Server process on 'daysqltest02'. Remote
calls are not allowed for this process." displays. If I manually run the
Visual Studio Remote Debugging Monitor interactively on the remote server,
when I attempt to step into a procedure, an entry is displayed in the monitor
that a connection from my workstation has been made and the following message
is displayed "Unable to start T-SQL Debugging. Could not connect to computer
'daysqltest02'. The Microsoft Visual Studio Remote Debugging Monitor on the
remote computer does not have permission to connect to this computer. Please
see Help for assistance."
Other people in my office on the same network or other networks can
successfully debug and there is not firewall between my workstation and the
remote server so I know it is something with my security or communications
configuration. Any assistance would be much appreciated. Thanks in advance.
Ken
Hi Parch,
I suggest you try the tool SQL Ultimate Debugger:
http://lakesidesql.com/downloads/PFD/1_0_2007_809/PFDebugger_Setup_08-09-2007.zip.
This tool is a post factum debugger and allows you to trace and
debug obejcts (SP's Triggers, FN's, etc.) that had been executed. It's
waaaay better than the T-SQL debugger in VS. Also, since this software has
not yet been officially realeased, I would not recommend (YET) to use it in
a production environment.
You can learn more about it here:
http://208.75.249.50/products/sql-ultimate-debugger/screenshots.html. If you
want a copy of its documentation. shoot me an email and i can send it to
you.
I hope that helps.
"parchk" <parchk@.discussions.microsoft.com> wrote in message
news:F5E08E79-2BC6-4991-904A-A87465073520@.microsoft.com...
>I have done through all the MSDN documentation and Googled everything I
>could
> on the errors I am receiving about installing and configuring remote
> debugging. I believe it is communications related. This is the scenario:
> The Visual Studio 2005 Remote Debugger service is started on the remote
> database server that I want to debug SQL code on as Local System. I am a
> member of the local administrators group on that server and a member of
> the
> sa role in SQL Server. I configured all the DCOM settings on both the
> remote
> server and my local workstation, which is running XP SP2, and opened the
> firewall exceptions on my workstation.
> When I attempt to step into a procedure, the message " Unable to start
> T-SQL
> Debugging. Could not attach to SQL Server process on 'daysqltest02'.
> Remote
> calls are not allowed for this process." displays. If I manually run the
> Visual Studio Remote Debugging Monitor interactively on the remote server,
> when I attempt to step into a procedure, an entry is displayed in the
> monitor
> that a connection from my workstation has been made and the following
> message
> is displayed "Unable to start T-SQL Debugging. Could not connect to
> computer
> 'daysqltest02'. The Microsoft Visual Studio Remote Debugging Monitor on
> the
> remote computer does not have permission to connect to this computer.
> Please
> see Help for assistance."
> Other people in my office on the same network or other networks can
> successfully debug and there is not firewall between my workstation and
> the
> remote server so I know it is something with my security or communications
> configuration. Any assistance would be much appreciated. Thanks in
> advance.
> Ken
|||Hi Parch,
I suggest you try the tool SQL Ultimate Debugger:
http://lakesidesql.com/downloads/PFD/1_0_2007_809/PFDebugger_Setup_08-09-2007.zip.
This tool is a post factum debugger and allows you to trace and
debug obejcts (SP's Triggers, FN's, etc.) that had been executed. It's
waaaay better than the T-SQL debugger in VS. Also, since this software has
not yet been officially realeased, I would not recommend (YET) to use it in
a production environment.
You can learn more about it here:
http://208.75.249.50/products/sql-ultimate-debugger/screenshots.html. If you
want a copy of its documentation. shoot me an email and i can send it to
you.
I hope that helps.
"parchk" <parchk@.discussions.microsoft.com> wrote in message
news:F5E08E79-2BC6-4991-904A-A87465073520@.microsoft.com...
>I have done through all the MSDN documentation and Googled everything I
>could
> on the errors I am receiving about installing and configuring remote
> debugging. I believe it is communications related. This is the scenario:
> The Visual Studio 2005 Remote Debugger service is started on the remote
> database server that I want to debug SQL code on as Local System. I am a
> member of the local administrators group on that server and a member of
> the
> sa role in SQL Server. I configured all the DCOM settings on both the
> remote
> server and my local workstation, which is running XP SP2, and opened the
> firewall exceptions on my workstation.
> When I attempt to step into a procedure, the message " Unable to start
> T-SQL
> Debugging. Could not attach to SQL Server process on 'daysqltest02'.
> Remote
> calls are not allowed for this process." displays. If I manually run the
> Visual Studio Remote Debugging Monitor interactively on the remote server,
> when I attempt to step into a procedure, an entry is displayed in the
> monitor
> that a connection from my workstation has been made and the following
> message
> is displayed "Unable to start T-SQL Debugging. Could not connect to
> computer
> 'daysqltest02'. The Microsoft Visual Studio Remote Debugging Monitor on
> the
> remote computer does not have permission to connect to this computer.
> Please
> see Help for assistance."
> Other people in my office on the same network or other networks can
> successfully debug and there is not firewall between my workstation and
> the
> remote server so I know it is something with my security or communications
> configuration. Any assistance would be much appreciated. Thanks in
> advance.
> Ken
|||Thanks for the information. I will definitely look at this product and would
appreciate a copy of the documentation for review.
With this product, can stored procedures be interactiely debugged?
"The DBA" wrote:

> Hi Parch,
> I suggest you try the tool SQL Ultimate Debugger:
> http://lakesidesql.com/downloads/PFD/1_0_2007_809/PFDebugger_Setup_08-09-2007.zip.
> This tool is a post factum debugger and allows you to trace and
> debug obejcts (SP's Triggers, FN's, etc.) that had been executed. It's
> waaaay better than the T-SQL debugger in VS. Also, since this software has
> not yet been officially realeased, I would not recommend (YET) to use it in
> a production environment.
> You can learn more about it here:
> http://208.75.249.50/products/sql-ultimate-debugger/screenshots.html. If you
> want a copy of its documentation. shoot me an email and i can send it to
> you.
> I hope that helps.
>
>
> "parchk" <parchk@.discussions.microsoft.com> wrote in message
> news:F5E08E79-2BC6-4991-904A-A87465073520@.microsoft.com...
>