Solved

SQL Password on connection

Posted on 2008-06-10
6
219 Views
Last Modified: 2013-11-30
Hi all, I have the following that works perfectly fine:

Dim da As New SqlDataAdapter
                Dim conn As SqlConnection = New SqlConnection("Data Source=SQLRPT;Initial Catalog=CorpReports;Persist Security Info=True;async=true;User ID=apps;Password=...")
                Dim cmd As New SqlCommand("hsp_rpt_GrossMargin_Web", conn)

BUT, I want to remove the passwords and use this as a trusted connection, like this:

 Dim da As New SqlDataAdapter
                Dim conn As SqlConnection = New SqlConnection("Data Source=SQLRPT;Initial Catalog=CorpReports;Persist Security Info=True;async=true;Trusted_Connection=Yes")
                Dim cmd As New SqlCommand("hsp_rpt_GrossMargin_Web", conn)

Everything works fine for this when filling a grid or a dropdown or calling for data.  The problem I have is when calling a procedure,  it doesn't seem to want to let me do that.  It runs fine from my local machine, but not from the website.  I have given the server login all the permissions to login to the server and get to all of the Databases.  Like I said, it runs fine to allow me to edit, add or pull data from the databases, but will not allow me to run a procedure...

Thanks,
Randy
0
Comment
Question by:ratkinso666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 5

Expert Comment

by:scgstuff
ID: 21752567
Try adding Execute permissions to the account the server is using.  I believe it is the ASPNET account on the web server's machine you will need to use.  It may be Network Service, but I think ASPNET is all you need.

Shawn
0
 

Author Comment

by:ratkinso666
ID: 21754993
In the Internet Services Manager???  I have changed everything in there I can see..  I did change it to do scripts and executables.  It still will not run the procedures though...
0
 
LVL 5

Accepted Solution

by:
scgstuff earned 500 total points
ID: 21755269
In the SQL Server Management Studio, set the permission for the DB to allow the accounts to execute.

Right click on the database
Click on Properties
Select Permissions from the list
Add user ASPNET (and you might want to try NT Authority/Network Service if that doesn't do it.)
Scroll down to Execute and check Grant
OK out of it and try again.

If the user does not show up in the pick list when you do this, you may need to:
Go to Security for the SQL Server (also in SSMS)
Right Click on Logins
Select New Login
Search for user and add

Shawn
0
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

Author Comment

by:ratkinso666
ID: 21759304
OK, I found in the Stored Procedures (SQL 2000 by the way) where to add EXEC in the checkboxes, so I added that to my Web1$, which is our login, added ALL the checkboxes at the database level, which does not include the EXEC, and it still doesn't work...  runs fine from my local machine and my login isn't even in the list at all...

Thanks,
Randy
0
 

Author Comment

by:ratkinso666
ID: 21759909
Hi Shawn, I have decided to convert the ones that will not work to using connection strings that I will just have a password in the web.config file and that seems to work just fine.  I will just have to manually change that password every 6 months...

Thanks,
Randy
0
 

Author Closing Comment

by:ratkinso666
ID: 31465784
Thanks for your help Shawn
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question