Showing posts with label applications. Show all posts
Showing posts with label applications. Show all posts

Thursday, March 29, 2012

Console apps work for SA but no other user

Hi

My console applications work forSA and no other user. I can run the Stored procedures used in the console application from Query analyser when logged in with username/password that I am attempting to use for console applications. I am using SQL server authenication. User access permissions look ok in Enterprise Manager. Access is permit for my user.

Any suggestions?

Thanks

Permissions in SQL are much more than just access permit. You should also grant EXECUTE permssion for a stored procedure to a user if you want the user to execute the stored procedure; or you can create a role and add the user as member, then grant proper permissions to the role. To understand permissions related concepts in SQL, you can start from here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_03_8q2b.asp

sqlsql

Sunday, March 25, 2012

Connectivity Stand-Alone installer

Hi all,
I want my application's Installer to automatically install the SQL
Connectivity on machine in which the Connectivity does not exist. For this i
require a Stand-Alone installer (to be called from my Installer if
connectivity is not found).
Do you know if there exists a Stand-Alone Connectivity Installer?
Also how can i check if Connectivity is installed or not (from the
Installer)
Thanks
Shaun
Hi
MDAC is the client connectivity.
http://msdn.microsoft.com/data/downl...s/default.aspx
Current version is 2.8
Regards
Mike
"Shaun Camilleri" wrote:

> Hi all,
> I want my application's Installer to automatically install the SQL
> Connectivity on machine in which the Connectivity does not exist. For this i
> require a Stand-Alone installer (to be called from my Installer if
> connectivity is not found).
> Do you know if there exists a Stand-Alone Connectivity Installer?
> Also how can i check if Connectivity is installed or not (from the
> Installer)
> Thanks
> Shaun
>
>
|||Thanks that is what I needed.
Shaun
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:B25625E8-8D72-4A80-8A49-0F249B044998@.microsoft.com...[vbcol=seagreen]
> Hi
> MDAC is the client connectivity.
> http://msdn.microsoft.com/data/downl...s/default.aspx
> Current version is 2.8
> Regards
> Mike
> "Shaun Camilleri" wrote:
this i[vbcol=seagreen]

Thursday, March 22, 2012

Connectivity Issues

We’re having a problem with our web applications connecting to the SQL DB
virtual server cluster. We are running SQL 2000 an '03 Server Cluster. The
front-end web servers are Win2K, IIS 5. The web servers and the database
server reside on the same LAN and the front end can ping the backend using
either IP or SQL cluster name successfully.
The clustering is functioning properly and has passed all failover testing
scenarios including the SQL Server resources. The ASP code is using a
Globaldb include file to point to a production database. When I point any of
3 web servers to a single SQL server offering the same exact databases,
users, logins, etc., IE makes the connections with no problem. When
attempting to do the same to the clustered virtual server, we get either a
“500 Internal Server” error or a blank page that says “Done” on the IE status
bar at the bottom of the window. No connection to the database is completed
Is there something we are missing to make this connection work? What can I
look at?
Thank you very much.
Apply MDAC 2.8 to all your client machines. Early versions of MDAC were not
instance aware. Cluster names (VitrualServerName\InstanceName) use the same
syntax as multi-instance SQL servers and look the same on an network.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Fonkberry" <Fonkberry@.discussions.microsoft.com> wrote in message
news:296ABC73-4A0B-44BC-8221-F5498C903DDD@.microsoft.com...
> We're having a problem with our web applications connecting to the SQL DB
> virtual server cluster. We are running SQL 2000 an '03 Server Cluster. The
> front-end web servers are Win2K, IIS 5. The web servers and the database
> server reside on the same LAN and the front end can ping the backend using
> either IP or SQL cluster name successfully.
> The clustering is functioning properly and has passed all failover testing
> scenarios including the SQL Server resources. The ASP code is using a
> Globaldb include file to point to a production database. When I point any
of
> 3 web servers to a single SQL server offering the same exact databases,
> users, logins, etc., IE makes the connections with no problem. When
> attempting to do the same to the clustered virtual server, we get either a
> "500 Internal Server" error or a blank page that says "Done" on the IE
status
> bar at the bottom of the window. No connection to the database is
completed
> Is there something we are missing to make this connection work? What can I
> look at?
> Thank you very much.
>

Thursday, March 8, 2012

Connection to SQL 2000 database with .Net 1 Application

Hi there,

Has anyone ever encountered problems making .Net applications connect to a SQL database on SQL 2000 with SP3a?

It's running on a virtual machine with a Windows Server 2000 Std with SP4, the .Net application is working with .Net Framework 1.1.4322.573.For some reason it can't connect to the SQL database using the specified username and password in the web.config file even though the user exists in the SQL database. I've tried using the SA password but this still doesn't work. I can logon to SQL Query Analyzer using the SA password but not using the other username.

The .Net application does work on other systems of mine all of which can run on Windows Server 2000 and 2003, I have compared them but can't find any differences.

Any ideas anybody?

Thanks,

Chris

I'm guessing that your SQL2000 instance is set up for Windows only logins.
In enterprise Manager right click on the server and select "properties".
In the security tab ensure that the Authentication mode is "SQL Server and Windows".

Wednesday, March 7, 2012

Connection Timeout

I’ve 2 database servers. These servers communicate with the other’s databases
via TCP/IP with SQL authentication using VB, COM+ & ASP applications. Both
servers are running W2k & SQL2k, each with the latest SPs & hot fixes.
Neither server is a domain server. Server A also supports a VB application
the users access through Terminal Services sessions.
Recently we began experiencing a problem on server A. When logged on to the
server with an administrator account the user can connect to the other
server’s database through the VB applications & through SQL Query Analyzer.
However, when logged on as a user that isn’t an administrator, they cannot
connect to the other server; they get a Timeout Expired error message. This
occurs every time.
From server A when logged on as a standard user we can telnet to server B on
port 1433. We cannot odbcping nor use SQL Query Analyzer to connect to server
B. The IP address & the SQL user /password is included in all connections.
I ran Netmon on server B to see what was coming from server A. I only saw
ack messages. I’m not a Netmon expert, so interpreting these messages is a
little beyond me.
I also suspect the problem is on server A. Why else would one user be able
to connect & another not. Beyond that I’m lost.
The only error I see in any of the Event logs from server A is an error
described by KB 326912.
Thanks in advance for any ideas.
You need to make the connections from the client side and review them. See
if the tcp 3 way handshake is completing.
Q169292 The Basics of Reading TCP/IP Traces
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
|||I'm able to see a 3 Way Hand Shake & Graceful Close. There is also some Push
activity in the trace.
Examining this activity is iffy at best, because these are production
servers. My problem only occurs when the user on Server A is not an
administrator. Some of the activity in the capture could be the result of
other user activity. I think the trace I captured was during an isolated
period, but I cannot be assured of this. The Hand Shake & Grageful Close were
the 1st & last events in the capture.
"Kevin McDonnell [MSFT]" wrote:

> You need to make the connections from the client side and review them. See
> if the tcp 3 way handshake is completing.
> Q169292 The Basics of Reading TCP/IP Traces
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>
|||Is there a policy defined on the system that might explain why there is a
permission problem?
gpresult.exe will show you if any policies are in place.
Are there any security templates in use?
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
|||I'm not aware of a policy that is set to do that.
I ran gpresult without learning much, which didn't surprise me since this is
a stand-alone server.
There are Local Policies, most are default values. I did read through all of
these & nothing stuck out as a possible culprit. Do you have any policies in
mind that may need further scrutiny?
Sam
"Kevin McDonnell [MSFT]" wrote:

> Is there a policy defined on the system that might explain why there is a
> permission problem?
> gpresult.exe will show you if any policies are in place.
> Are there any security templates in use?
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>
|||Clients need "access this computer from the network" permission in order to
establish a connection.
Can the same client map a drive to the server?
Does the problem happen with Named Pipes as well as TCP/IP?
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
|||I checked the 'Access this computer from the Network' local policy. It
includes Users.
The user connects to Server A through a Terminal Services Connection.
Mapping a drive isn't an option I've pursued.
Since these are standalone servers I don't know how to connect from one to
the other using named pipes. (One is in Atlanta & the other in Washington DC.
They communicate via Internet. Force Encryption is on.) If I enter the
www.servername.com of Server B, I think that uses TCP/IP. I tried it in Query
Analyzer & got the Timeout message.
I installed FileMon from www.SysInternal.com on Server A. I saw some files
that were not found, but the system reverted to Winnt\system32 for the same
files & was succesful. I didn't see any unsuccessful attempts logged for the
User. This leads me to suppose it isn't a file permission problem.
I restarted Server A last night, but this didn't accompolish anything either.
Sam
"Kevin McDonnell [MSFT]" wrote:

> Clients need "access this computer from the network" permission in order to
> establish a connection.
> Can the same client map a drive to the server?
> Does the problem happen with Named Pipes as well as TCP/IP?
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>
|||I would run Microsoft Network Monitor from the Terminal Server machine to
trace the traffic to SQL.
Compare the admin trace to the user trace.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
|||I have the traces. I was able to run them when there wasn't any other
activity between the systems.
Both traces are escentially the the same except in the admin trace I see
more TDS protocol packets. Both start with the 3 Way Hand Shake & end with
the Graceful Close. The 1st 12 packets of each trace are the same. Then the
admin trace has 12 TDS protocol packets with a description beginning with
'UNKNOWN EPM ACK Len ='. The trace that fails does not have any of these
packets.
The user trace does have some TDS protocol packets, but for some reason that
the trace doesn't show, it doesn't continue with the TDS packets the admin
trace has.
Sam
"Kevin McDonnell [MSFT]" wrote:

> I would run Microsoft Network Monitor from the Terminal Server machine to
> trace the traffic to SQL.
> Compare the admin trace to the user trace.
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>
|||Hi Sam,
Sounds like you made a good capture. Unfortunately, the best way to
resolve this would be to open a case and have a SQL Engineer review the
traces. It would be too difficult to diagnose the traces in this forum.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Connection Timeout

In one of my applications I want to set a connection timeout to 1 second when connecting to the SQL Server. .NET's SqlConnection already has connectiontimeout property as readonly and set to 15 seconds. So I cant use it. And if I use adodb.dll and its ADODB.Connection, this time I can set the objects connectiontimeout property. However, it just doesn't work. It still waits along time even though I set the connectiontimeout to 1 second. The same goes when you try the same thing in Delphi.

Anyone has any idea about this problem?

Do you want to change the timeout on the command or the connection ? Normally people want to specify the timeout on the command rather than on the connection.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

How do you check and find "SqlConnection already has connectiontimeout property as readonly and set to 15 seconds"? From what I see in VS 2005, I can edit connectiontimeout property for sqlclient.

Regarding why it still take a long time even if you set the timeout to 1 second, that's because the timeout property is enforced in different layer, specifically higer layer. If a connection is blocked or waiting in a API in lower level, it won't stop the connection until it returns from lower level. If there is still time left, higher level may try to connect again. So, the timeout is not always enforced, you should not use it for precise timing.

Saturday, February 25, 2012

Connection Timeout

I’ve 2 database servers. These servers communicate with the other’s data
bases
via TCP/IP with SQL authentication using VB, COM+ & ASP applications. Both
servers are running W2k & SQL2k, each with the latest SPs & hot fixes.
Neither server is a domain server. Server A also supports a VB application
the users access through Terminal Services sessions.
Recently we began experiencing a problem on server A. When logged on to the
server with an administrator account the user can connect to the other
server’s database through the VB applications & through SQL Query Analyzer
.
However, when logged on as a user that isn’t an administrator, they cannot
connect to the other server; they get a Timeout Expired error message. This
occurs every time.
From server A when logged on as a standard user we can telnet to server B on
port 1433. We cannot odbcping nor use SQL Query Analyzer to connect to serve
r
B. The IP address & the SQL user /password is included in all connections.
I ran Netmon on server B to see what was coming from server A. I only saw
ack messages. I’m not a Netmon expert, so interpreting these messages is a
little beyond me.
I also suspect the problem is on server A. Why else would one user be able
to connect & another not. Beyond that I’m lost.
The only error I see in any of the Event logs from server A is an error
described by KB 326912.
Thanks in advance for any ideas.You need to make the connections from the client side and review them. See
if the tcp 3 way handshake is completing.
Q169292 The Basics of Reading TCP/IP Traces
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||I'm able to see a 3 Way Hand Shake & Graceful Close. There is also some Push
activity in the trace.
Examining this activity is iffy at best, because these are production
servers. My problem only occurs when the user on Server A is not an
administrator. Some of the activity in the capture could be the result of
other user activity. I think the trace I captured was during an isolated
period, but I cannot be assured of this. The Hand Shake & Grageful Close wer
e
the 1st & last events in the capture.
"Kevin McDonnell [MSFT]" wrote:

> You need to make the connections from the client side and review them. Se
e
> if the tcp 3 way handshake is completing.
> Q169292 The Basics of Reading TCP/IP Traces
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>|||Is there a policy defined on the system that might explain why there is a
permission problem?
gpresult.exe will show you if any policies are in place.
Are there any security templates in use?
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||I'm not aware of a policy that is set to do that.
I ran gpresult without learning much, which didn't surprise me since this is
a stand-alone server.
There are Local Policies, most are default values. I did read through all of
these & nothing stuck out as a possible culprit. Do you have any policies in
mind that may need further scrutiny?
Sam
"Kevin McDonnell [MSFT]" wrote:

> Is there a policy defined on the system that might explain why there is a
> permission problem?
> gpresult.exe will show you if any policies are in place.
> Are there any security templates in use?
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>|||Clients need "access this computer from the network" permission in order to
establish a connection.
Can the same client map a drive to the server?
Does the problem happen with Named Pipes as well as TCP/IP?
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||I checked the 'Access this computer from the Network' local policy. It
includes Users.
The user connects to Server A through a Terminal Services Connection.
Mapping a drive isn't an option I've pursued.
Since these are standalone servers I don't know how to connect from one to
the other using named pipes. (One is in Atlanta & the other in Washington DC
.
They communicate via Internet. Force Encryption is on.) If I enter the
www.servername.com of Server B, I think that uses TCP/IP. I tried it in Quer
y
Analyzer & got the Timeout message.
I installed FileMon from www.SysInternal.com on Server A. I saw some files
that were not found, but the system reverted to Winnt\system32 for the same
files & was succesful. I didn't see any unsuccessful attempts logged for the
User. This leads me to suppose it isn't a file permission problem.
I restarted Server A last night, but this didn't accompolish anything either
.
Sam
"Kevin McDonnell [MSFT]" wrote:

> Clients need "access this computer from the network" permission in order t
o
> establish a connection.
> Can the same client map a drive to the server?
> Does the problem happen with Named Pipes as well as TCP/IP?
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>|||I would run Microsoft Network Monitor from the Terminal Server machine to
trace the traffic to SQL.
Compare the admin trace to the user trace.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||I have the traces. I was able to run them when there wasn't any other
activity between the systems.
Both traces are escentially the the same except in the admin trace I see
more TDS protocol packets. Both start with the 3 Way Hand Shake & end with
the Graceful Close. The 1st 12 packets of each trace are the same. Then the
admin trace has 12 TDS protocol packets with a description beginning with
'UNKNOWN EPM ACK Len ='. The trace that fails does not have any of these
packets.
The user trace does have some TDS protocol packets, but for some reason that
the trace doesn't show, it doesn't continue with the TDS packets the admin
trace has.
Sam
"Kevin McDonnell [MSFT]" wrote:

> I would run Microsoft Network Monitor from the Terminal Server machine to
> trace the traffic to SQL.
> Compare the admin trace to the user trace.
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>|||Hi Sam,
Sounds like you made a good capture. Unfortunately, the best way to
resolve this would be to open a case and have a SQL Engineer review the
traces. It would be too difficult to diagnose the traces in this forum.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Sunday, February 19, 2012

Connection String for selling Web Applications?

If I'm wanting to sell my Web Applications to clients that run using SQL Server, is it best to use a UserID and Password in the connection string, or would using Windows Integrated Security (SSPI) do? The reason I'm wondering is because I wouldn't know my customer's UserID and Password when they purchased one of my web apps, I would have to recompile the app with the new connection string (I'm not storing it in the web.config file)..

What is the best way to handle this on a global level, so that it would work on any system?

for example, would having the following connection string be a good idea for a production site?

string strMyConnectionString = " Data Source = (local); Integrated Security = SSPI; Initital Catalog = MyDBSource; ";It would really be better to allow it to be specified in the Web.Config. What happens if the database is not located on the same machine?|||Why are you not storing it in the web.config file ?|||I didn't store it in the web.config file for security reasons. Would the web.config be the best way to go? Should I encrypt the string?|||Yes and Yes