Showing posts with label user. Show all posts
Showing posts with label user. 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

console apps only work if user is SA

Hi

When I try to use a user other then SA my console apps don't work.

I can run the Stored Procedures used in console application from Query analyser when logged in with the username/password that
I'm attempting to use for the console applications.

Under Users in Enterprise Manager Database access is 'permit' for my user.

By the way my web application which uses the same user name and password as in console applications is working. I also have dts packages running using dtsexec accessing the database with the same user name and password and they work fine.

MDAC 2.8 SP2 on windows server 2003 spi

C:\Program Files\Microsoft SQL Server\80\Tools\Binn>ODBCPING.EXE -S xxx.xxx.xxx.xxx
-U myusername -P mypassword

CONNECTED TO SQL SERVER

ODBC SQL Server Driver Version: 03.86.1830

SQL Server Version: Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)

If the connection is available then why is the adapter.fill method failing?

I tried it using a text sql statement and that doesn't work either.

The problem isn't database specific as I did a test .bat on Northwind sample database and got same 'general network error'

Here's the error:

apps\Exports>exporter.bat

Unhandled Exception: System.Data.SqlClient.SqlException: General network error.
Check your network documentation.
at System.Data.SqlClient.ConnectionPool.CreateConnection()
at System.Data.SqlClient.ConnectionPool.UserCreateRequest()
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransactio
n)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConn
ectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, Conne
ctionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startR
ecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior be
havior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)

//Testing using SELECT statement as command text

D\Test>Test.bat

D:\Test>TestDBAccess.exe "server=xxx.xxx.xxx.xxx;uid=xxxx;pwd=xxx;
database=Northwind;"

Unhandled Exception: System.Data.SqlClient.SqlException: General network error.
Check your network documentation.
at System.Data.SqlClient.ConnectionPool.CreateConnection()
at System.Data.SqlClient.ConnectionPool.UserCreateRequest()
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransactio
n)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConn
ectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()

D:\Test>

Any ideas/help much appreciated!

Hi,

would be cool if you could show us your code.Sometimes people hardcode certain properties (I confess that I did that on my own one time :-) ) which will lead to an error where usally there shouldn′t be an error (especially in console apps where connection properties are passed via arguments which isn′t testable while debugging within VS)

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

Hi,

Here's the essentials of the code (without some try catch statements).

Thanks.

KH

.bat file

::arg 0 Connection String
::arg 1 Export Path //just a path where I want the output file to go


Exporter.exe "server=xxx.xxx.xxx.xxx;uid=username;pwd=password;database=DATABASENAME;" "d:\\xxx\\xxx\\ExportOut\\"


Source code


using System;

using System.Data;
using System.Security;
using System.Security.Permissions;
using System.Security.Policy;
using System.Configuration;
using System.Data.SqlClient;
using System.IO;


namespace Exporter
{
class Export
{

private static String ConnectionString;

private static String ExportPath;

private static StreamWriter ExportLog;

[STAThread]
static void Main(string[] args)
{

ConnectionString = args[0];

ExportPath = args[1];

String DateString = System.DateTime.Today.Day.ToString() + "_" + System.DateTime.Today.Month.ToString();

ExportLog = new StreamWriter(ExportPath+"Export_Log_"+DateString+".txt");

DoExport();

ExportLog.Close();

}

private static void DoExport()
{

ExportLog.WriteLine("Beginning export");
GetData());


}



private static void GetData()
{


SqlCommand SelectCommand = new SqlCommand();

SelectCommand.CommandType=(System.Data.CommandType.StoredProcedure);

SelectCommand.CommandText="GetCSVOutput";

SqlConnection Conn = new SqlConnection(ConnectionString);

SelectCommand.Connection=Conn;



SqlDataAdapter ReportAdapter = new SqlDataAdapter();

FaultReportAdapter.SelectCommand=SelectCommand;

DataSet ReportData = new DataSet();


ReportAdapter.Fill(ReportData,"Report");

if (ReportData.Tables["Report"].Rows.Count == 0)
{
Conn.Close();
ExportLog.WriteLine("No reports to export");
return false;

}
else
{
Conn.Close();
return MakeFile(ReportData);

}

}


private static void MakeFile(DataSet FaultReportData)
{


/* Just prints out the results of Stored procedure to file and closes file */




}


|||Hi,

beside that the FaultReportDapater doesn′t exists (but I guess this is just a typo) you can try disabling the connection pool to see if it is based on this with adding the keywords "Pooling=False" to the connecting string.

HTH, Jens Suessmeyer.

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

Hi,

Yes that was just a typo. With pooling set to false I still get the same error.

Thanks

KH

|||

What is the call stack of the exception if you disable pooling?

|||

Here's the call stack with pooling set to false.

D:\apps\Export>exporter.bat

D:\content\apps>Exporter.exe "server=xxx.xxx.xxx.xxx;uid=xxxx;pwd=;database=xxxx;pooling=False" "d:\\Content\\xxxx\\ExportOut\\"

Unhandled Exception: System.Data.SqlClient.SqlException: General network error.
Check your network documentation.
at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()
at System.Data.SqlClient.SqlInternalConnection..ctor(SqlConnection connection
, SqlConnectionString connectionOptions)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, Conne
ctionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startR
ecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior be
havior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at Exporter.Export.GetData() in
\\xxxx\dotnet_dll_production
\xxxx\xxxxx\export.cs:line 536
at Exporter.Export.DoExport() in
\\xxxx\dotnet_dll_production\xxxx\xxxx\export.cs:line 143
at Exporter.Export.Main(String[] args) in \\xxxx\dotnet_dll_produc
tion\xxxx\xxxx\export.cs:line 95

D:\apps\Export>

Sunday, March 25, 2012

Connectivty problem from NON domain users

I have a problem esteblishing a connection to a SQL server with a SQL user,
while I am logged to the computer with a local computer.
Any domain account can has no problem.
What can ause this?
Thanks in advance,
Ido Friedman
What tool are you connecting from?
How are you trying to connect?
Do you know for sure that you are trying to connect via SQL Authentication?
Have you tried hitting the Data Sources (ODBC) applet within the Control
Panel and creating a test connection?
Keith Kratochvil
"Ido friedman" <Idofriedman@.discussions.microsoft.com> wrote in message
news:934F22F5-2624-49B2-AC35-1970C1AE876D@.microsoft.com...
>I have a problem esteblishing a connection to a SQL server with a SQL user,
> while I am logged to the computer with a local computer.
> Any domain account can has no problem.
> What can ause this?
> Thanks in advance,
> Ido Friedman
|||Do you have mixed mode authentication enabled?
To enable...
SQL 2005
In SQL Server Management Studio Object Explorer, right-click your server,
and then click Properties.
On the Security page, under Server authentication, select the new server
authentication mode, and then click OK.
In the SQL Server Management Studio dialog box, click OK, to acknowledge the
need to restart SQL Server.
SQL 2000
Expand a server group.
Right-click a server, and then click Properties.
Click the Security tab.
Under Authentication, click SQL Server and Windows.
Under Audit level, select the level at which user accesses to Microsoft SQL
ServerT are recorded in the SQL Server error log:
None causes no auditing to be performed.
Success causes only successful login attempts to be audited.
Failure causes only failed login attempts to be audited.
All causes successful and failed login attempts to be audited.
Hope that helps...
/*
Warren Brunk - MCITP - SQL 2005, MCDBA
www.techintsolutions.com
*/
"Ido friedman" <Idofriedman@.discussions.microsoft.com> wrote in message
news:934F22F5-2624-49B2-AC35-1970C1AE876D@.microsoft.com...
>I have a problem esteblishing a connection to a SQL server with a SQL user,
> while I am logged to the computer with a local computer.
> Any domain account can has no problem.
> What can ause this?
> Thanks in advance,
> Ido Friedman
|||Thanks for your reply,
I am using the following ASP page:
The page is running in IIS under the local user IUser_computername.
When I run the same code with a domain account it successeds.
Thanks in advance,
Ido Friedman
<%
Dim dataSource
On Error Resume Next
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.open "PROVIDER=SQLOLEDB;DATA
SOURCE=servername";UID=user;PWD=user;DATABASE=nort hwind"
If err.number = 0 Then
Response.Write(cnn.State)
cnn.Close
Else
Response.Write( err.Description )
End If
Response.End
%>
"Warren Brunk" wrote:

> Do you have mixed mode authentication enabled?
> To enable...
> SQL 2005
> In SQL Server Management Studio Object Explorer, right-click your server,
> and then click Properties.
> On the Security page, under Server authentication, select the new server
> authentication mode, and then click OK.
> In the SQL Server Management Studio dialog box, click OK, to acknowledge the
> need to restart SQL Server.
>
> SQL 2000
> Expand a server group.
>
> Right-click a server, and then click Properties.
>
> Click the Security tab.
>
> Under Authentication, click SQL Server and Windows.
>
> Under Audit level, select the level at which user accesses to Microsoft? SQL
> ServerT are recorded in the SQL Server error log:
> None causes no auditing to be performed.
>
> Success causes only successful login attempts to be audited.
>
> Failure causes only failed login attempts to be audited.
>
> All causes successful and failed login attempts to be audited.
>
> Hope that helps...
>
> --
> /*
> Warren Brunk - MCITP - SQL 2005, MCDBA
> www.techintsolutions.com
> */
>
> "Ido friedman" <Idofriedman@.discussions.microsoft.com> wrote in message
> news:934F22F5-2624-49B2-AC35-1970C1AE876D@.microsoft.com...
>
>

Connectivity?

Dev Tool: VB6
Server: SQL Server 2000.
Environment: Windows 2000/Windows XP/Windows 2000 Server
I have changed a user connectivity from WINDOWS NT trusted connection to
SQL Server Authentication.
I have granted the same permissions to the new user.
The problem is as follows:
The new user cannot execute stored procedures which contains INSERT staments
.
Having the same connection and user id. When I execute the stored procedure
in the Query Analyzer console I have no problem, but when I execute it in a
Visual Basic 6.0 Application, using ADO, I get the following message:
"Operation is not Allowed when the Object is closed."
Note: I created the table, so I'm the owner, I should have no problems(??)
Any ideas?
RickRick,
Can you send your vb code where you open the ADO connection, execute the
stored proc, and then close the connection?
Thanks,
Yosh
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:131F18F8-146E-410F-8E84-2610E2871512@.microsoft.com...
> Dev Tool: VB6
> Server: SQL Server 2000.
> Environment: Windows 2000/Windows XP/Windows 2000 Server
> I have changed a user connectivity from WINDOWS NT trusted connection to
> SQL Server Authentication.
> I have granted the same permissions to the new user.
> The problem is as follows:
> The new user cannot execute stored procedures which contains INSERT
> staments.
> Having the same connection and user id. When I execute the stored
> procedure
> in the Query Analyzer console I have no problem, but when I execute it in
> a
> Visual Basic 6.0 Application, using ADO, I get the following message:
> "Operation is not Allowed when the Object is closed."
> Note: I created the table, so I'm the owner, I should have no problems(?)
> Any ideas?
>
> --
> Rick|||I get an error with the debugger.
Rick
"Yosh" wrote:

> Rick,
> Can you send your vb code where you open the ADO connection, execute the
> stored proc, and then close the connection?
> Thanks,
> Yosh
> "Rick" <Rick@.discussions.microsoft.com> wrote in message
> news:131F18F8-146E-410F-8E84-2610E2871512@.microsoft.com...
>
>

connectivity problem

good morning!
All was fine until a few hours ago. the sequel was set to windows
authentication only. then i realized i needed a sequel user account which i
then created. then i tried to switch back to mixed mode to make the account
work. things hung for a while and when restarted the sequel no longer accept
s
either windows accounts or the new sequel account. so i have basically locke
d
myself out. do i need to reinstall? is there an easy way to reset the
authentication mode without being able to get into the engine itself? thanks
.
-BahmanYou should be able to switch between the authentication modes. Did you get
any error message when tryin to log in?
Linchi
"Bahman" wrote:

> good morning!
> All was fine until a few hours ago. the sequel was set to windows
> authentication only. then i realized i needed a sequel user account which
i
> then created. then i tried to switch back to mixed mode to make the accoun
t
> work. things hung for a while and when restarted the sequel no longer acce
pts
> either windows accounts or the new sequel account. so i have basically loc
ked
> myself out. do i need to reinstall? is there an easy way to reset the
> authentication mode without being able to get into the engine itself? than
ks.
> -Bahman
>|||yes i did.
it said that it could not connect to sequel. it said one reason could be
that by default sequel 2005 does not allow remote connections.
so i went into surface area and added that functionlity. but surface area
does not allow me to check on authentication mode and switch it. the only
place i could do that was on the engine itself, which i cannot get to at the
moment.
the other issue is that the agent does not start at all. if i try to start
the service is says the service did not start and did not return an error
code. so, i don't know what it is i need to fix.
-Bahman
"Linchi Shea" wrote:
[vbcol=seagreen]
> You should be able to switch between the authentication modes. Did you get
> any error message when tryin to log in?
> Linchi
> "Bahman" wrote:
>|||Bahman,
Are the buttons greyed out for switching modes. I need to switch from
windows to mixed in 2005 but both buttons are greyed out. Any ideas on how
I
can switch to mixed?
Thanks
John
"Bahman" wrote:
[vbcol=seagreen]
> yes i did.
> it said that it could not connect to sequel. it said one reason could be
> that by default sequel 2005 does not allow remote connections.
> so i went into surface area and added that functionlity. but surface area
> does not allow me to check on authentication mode and switch it. the only
> place i could do that was on the engine itself, which i cannot get to at t
he
> moment.
> the other issue is that the agent does not start at all. if i try to start
> the service is says the service did not start and did not return an error
> code. so, i don't know what it is i need to fix.
> -Bahman
> "Linchi Shea" wrote:
>|||John,
sorry for delay.
I rebuilt the system. It was gone too far away.
-Bahman
"John B." wrote:
[vbcol=seagreen]
> Bahman,
> Are the buttons greyed out for switching modes. I need to switch from
> windows to mixed in 2005 but both buttons are greyed out. Any ideas on ho
w I
> can switch to mixed?
> Thanks
> John
> "Bahman" wrote:
>

connectivity problem

good morning!
All was fine until a few hours ago. the sequel was set to windows
authentication only. then i realized i needed a sequel user account which i
then created. then i tried to switch back to mixed mode to make the account
work. things hung for a while and when restarted the sequel no longer accepts
either windows accounts or the new sequel account. so i have basically locked
myself out. do i need to reinstall? is there an easy way to reset the
authentication mode without being able to get into the engine itself? thanks.
-BahmanYou should be able to switch between the authentication modes. Did you get
any error message when tryin to log in?
Linchi
"Bahman" wrote:
> good morning!
> All was fine until a few hours ago. the sequel was set to windows
> authentication only. then i realized i needed a sequel user account which i
> then created. then i tried to switch back to mixed mode to make the account
> work. things hung for a while and when restarted the sequel no longer accepts
> either windows accounts or the new sequel account. so i have basically locked
> myself out. do i need to reinstall? is there an easy way to reset the
> authentication mode without being able to get into the engine itself? thanks.
> -Bahman
>|||yes i did.
it said that it could not connect to sequel. it said one reason could be
that by default sequel 2005 does not allow remote connections.
so i went into surface area and added that functionlity. but surface area
does not allow me to check on authentication mode and switch it. the only
place i could do that was on the engine itself, which i cannot get to at the
moment.
the other issue is that the agent does not start at all. if i try to start
the service is says the service did not start and did not return an error
code. so, i don't know what it is i need to fix.
-Bahman
"Linchi Shea" wrote:
> You should be able to switch between the authentication modes. Did you get
> any error message when tryin to log in?
> Linchi
> "Bahman" wrote:
> > good morning!
> >
> > All was fine until a few hours ago. the sequel was set to windows
> > authentication only. then i realized i needed a sequel user account which i
> > then created. then i tried to switch back to mixed mode to make the account
> > work. things hung for a while and when restarted the sequel no longer accepts
> > either windows accounts or the new sequel account. so i have basically locked
> > myself out. do i need to reinstall? is there an easy way to reset the
> > authentication mode without being able to get into the engine itself? thanks.
> >
> > -Bahman
> >
> >|||Bahman,
Are the buttons greyed out for switching modes. I need to switch from
windows to mixed in 2005 but both buttons are greyed out. Any ideas on how I
can switch to mixed?
Thanks
John
"Bahman" wrote:
> yes i did.
> it said that it could not connect to sequel. it said one reason could be
> that by default sequel 2005 does not allow remote connections.
> so i went into surface area and added that functionlity. but surface area
> does not allow me to check on authentication mode and switch it. the only
> place i could do that was on the engine itself, which i cannot get to at the
> moment.
> the other issue is that the agent does not start at all. if i try to start
> the service is says the service did not start and did not return an error
> code. so, i don't know what it is i need to fix.
> -Bahman
> "Linchi Shea" wrote:
> > You should be able to switch between the authentication modes. Did you get
> > any error message when tryin to log in?
> >
> > Linchi
> >
> > "Bahman" wrote:
> >
> > > good morning!
> > >
> > > All was fine until a few hours ago. the sequel was set to windows
> > > authentication only. then i realized i needed a sequel user account which i
> > > then created. then i tried to switch back to mixed mode to make the account
> > > work. things hung for a while and when restarted the sequel no longer accepts
> > > either windows accounts or the new sequel account. so i have basically locked
> > > myself out. do i need to reinstall? is there an easy way to reset the
> > > authentication mode without being able to get into the engine itself? thanks.
> > >
> > > -Bahman
> > >
> > >|||John,
sorry for delay.
I rebuilt the system. It was gone too far away.
-Bahman
"John B." wrote:
> Bahman,
> Are the buttons greyed out for switching modes. I need to switch from
> windows to mixed in 2005 but both buttons are greyed out. Any ideas on how I
> can switch to mixed?
> Thanks
> John
> "Bahman" wrote:
> > yes i did.
> >
> > it said that it could not connect to sequel. it said one reason could be
> > that by default sequel 2005 does not allow remote connections.
> >
> > so i went into surface area and added that functionlity. but surface area
> > does not allow me to check on authentication mode and switch it. the only
> > place i could do that was on the engine itself, which i cannot get to at the
> > moment.
> >
> > the other issue is that the agent does not start at all. if i try to start
> > the service is says the service did not start and did not return an error
> > code. so, i don't know what it is i need to fix.
> >
> > -Bahman
> >
> > "Linchi Shea" wrote:
> >
> > > You should be able to switch between the authentication modes. Did you get
> > > any error message when tryin to log in?
> > >
> > > Linchi
> > >
> > > "Bahman" wrote:
> > >
> > > > good morning!
> > > >
> > > > All was fine until a few hours ago. the sequel was set to windows
> > > > authentication only. then i realized i needed a sequel user account which i
> > > > then created. then i tried to switch back to mixed mode to make the account
> > > > work. things hung for a while and when restarted the sequel no longer accepts
> > > > either windows accounts or the new sequel account. so i have basically locked
> > > > myself out. do i need to reinstall? is there an easy way to reset the
> > > > authentication mode without being able to get into the engine itself? thanks.
> > > >
> > > > -Bahman
> > > >
> > > >

Thursday, March 22, 2012

Connectivity from MS Access to Oracle

This probably isn't the right forum but here goes:
I have a user that is trying to connect from MS Access to Oracle. We can co
nnect and see the Oracle data in MS Access but I can't modify it. Supposedl
y that had it working on a different machine that has been replaced but we c
an't get it to work now. W
e've tried using Microsoft ODBC for Oracle v. 2.575.1022.00 and two or three
different versions of Oracle for ODBC, but they all get the same results.
We've even tried connecting to Oracle as the table owner - still read-only a
ccess.
Any help would be greatly appreciated. If I should be posting this to a dif
ferent newsgroup, please let me know which one / where!
Thanks,
Mike Stuart
mstuart_nospam@.gates.comMake sure you specify a primary key or unique identifier
when you link the tables.
You may want to post this in the following newsgroup:
microsoft.public.access.odbcclientsvr
-Sue
On Tue, 9 Mar 2004 12:41:09 -0800, "mikron2"
<anonymous@.discussions.microsoft.com> wrote:

>This probably isn't the right forum but here goes:
>I have a user that is trying to connect from MS Access to Oracle. We can connect a
nd see the Oracle data in MS Access but I can't modify it. Supposedly that had it w
orking on a different machine that has been replaced but we can't get it to work now
.
We've tried using Microsoft ODBC for Oracle v. 2.575.1022.00 and two or three different ver
sions of Oracle for ODBC, but they all get the same results. We've even tried connecting t
o Oracle as the table owner - still read-only access.
>Any help would be greatly appreciated. If I should be posting this to a di
fferent newsgroup, please let me know which one / where!
>Thanks,
>Mike Stuart
>mstuart_nospam@.gates.com|||Dear Sue,
I'm using the SQLconfigdatasource to create a DSN for Oracle and the functio
n doesn't work with Windows XP.
If I remove the old DSn and runs the code, the DSN is created but the connec
tion to the Oracle tables fail. I have realized that if I create the DSN, st
op the code running, open the windows control panel and open and close the c
onfiguration of DSN the con
nection to the tables works fine.
I think that after the SQLconfigdatasource the DSN is created but lack somet
hing ( maybe an update of the WIN register) to work properly. This case does
nt happen in WIN 2000.
Can you help me? If you can answer me in my email : mauricio.farto@.itelefoni
ca.com.br
Thanks in advance.

Tuesday, March 20, 2012

Connections are flaky

Got a sql server 2000 unlimited user license running on a Dell Server (1
CPU). There are several automated programs running 24 -7 that need to access
the database, each running on its own PC. Problem is the programs will run
flawlessly for days and hours, connecting, doing their stuff, closing the
connections (they are in VB6 or VB.NET). They all use the same connection
strings and work with ADO OLEDB connections.
Then all of a sudden on on or the other machine a program that needs to
connect to the server will refuse to connect, with a valid connection string
(we trap it, its OK). The typical error we get back will be server not
found, but if we ping the server either by its name or by IP address on the
computer that is giving us the error, we get a ping response back OK.
We're looking at a possible hardware failure but then we can use the SQL
database OK from within Enterprise Mgr, no problem.
It does not make any sense. Has anyone come accross a similar situation,
what can we do to make this more reliable?
Any help greatly appreciated, we're at our wits end.
BobDoes it ever resolve itself, or once the connection is broken, it cannot
reconnect without restarting the program?!?
Could it be a DNS issue? Could it be that some of the VB6 applications are
not returning all of their resources properly?
I just throwing some ideas out there.
Rick Sawtell
MCT, MCSD, MCDBA
"RD" <nospam@.nospam.net> wrote in message
news:%23oouP$IsEHA.1816@.TK2MSFTNGP15.phx.gbl...
> Got a sql server 2000 unlimited user license running on a Dell Server (1
> CPU). There are several automated programs running 24 -7 that need to
access
> the database, each running on its own PC. Problem is the programs will run
> flawlessly for days and hours, connecting, doing their stuff, closing the
> connections (they are in VB6 or VB.NET). They all use the same connection
> strings and work with ADO OLEDB connections.
> Then all of a sudden on on or the other machine a program that needs to
> connect to the server will refuse to connect, with a valid connection
string
> (we trap it, its OK). The typical error we get back will be server not
> found, but if we ping the server either by its name or by IP address on
the
> computer that is giving us the error, we get a ping response back OK.
> We're looking at a possible hardware failure but then we can use the SQL
> database OK from within Enterprise Mgr, no problem.
> It does not make any sense. Has anyone come accross a similar situation,
> what can we do to make this more reliable?
> Any help greatly appreciated, we're at our wits end.
> Bob
>

Monday, March 19, 2012

Connections are flaky

Got a sql server 2000 unlimited user license running on a Dell Server (1
CPU). There are several automated programs running 24 -7 that need to access
the database, each running on its own PC. Problem is the programs will run
flawlessly for days and hours, connecting, doing their stuff, closing the
connections (they are in VB6 or VB.NET). They all use the same connection
strings and work with ADO OLEDB connections.
Then all of a sudden on on or the other machine a program that needs to
connect to the server will refuse to connect, with a valid connection string
(we trap it, its OK). The typical error we get back will be server not
found, but if we ping the server either by its name or by IP address on the
computer that is giving us the error, we get a ping response back OK.
We're looking at a possible hardware failure but then we can use the SQL
database OK from within Enterprise Mgr, no problem.
It does not make any sense. Has anyone come accross a similar situation,
what can we do to make this more reliable?
Any help greatly appreciated, we're at our wits end.
BobDoes it ever resolve itself, or once the connection is broken, it cannot
reconnect without restarting the program?!?
Could it be a DNS issue? Could it be that some of the VB6 applications are
not returning all of their resources properly?
I just throwing some ideas out there.
Rick Sawtell
MCT, MCSD, MCDBA
"RD" <nospam@.nospam.net> wrote in message
news:%23oouP$IsEHA.1816@.TK2MSFTNGP15.phx.gbl...
> Got a sql server 2000 unlimited user license running on a Dell Server (1
> CPU). There are several automated programs running 24 -7 that need to
access
> the database, each running on its own PC. Problem is the programs will run
> flawlessly for days and hours, connecting, doing their stuff, closing the
> connections (they are in VB6 or VB.NET). They all use the same connection
> strings and work with ADO OLEDB connections.
> Then all of a sudden on on or the other machine a program that needs to
> connect to the server will refuse to connect, with a valid connection
string
> (we trap it, its OK). The typical error we get back will be server not
> found, but if we ping the server either by its name or by IP address on
the
> computer that is giving us the error, we get a ping response back OK.
> We're looking at a possible hardware failure but then we can use the SQL
> database OK from within Enterprise Mgr, no problem.
> It does not make any sense. Has anyone come accross a similar situation,
> what can we do to make this more reliable?
> Any help greatly appreciated, we're at our wits end.
> Bob
>

Connections are flaky

Got a sql server 2000 unlimited user license running on a Dell Server (1
CPU). There are several automated programs running 24 -7 that need to access
the database, each running on its own PC. Problem is the programs will run
flawlessly for days and hours, connecting, doing their stuff, closing the
connections (they are in VB6 or VB.NET). They all use the same connection
strings and work with ADO OLEDB connections.
Then all of a sudden on on or the other machine a program that needs to
connect to the server will refuse to connect, with a valid connection string
(we trap it, its OK). The typical error we get back will be server not
found, but if we ping the server either by its name or by IP address on the
computer that is giving us the error, we get a ping response back OK.
We're looking at a possible hardware failure but then we can use the SQL
database OK from within Enterprise Mgr, no problem.
It does not make any sense. Has anyone come accross a similar situation,
what can we do to make this more reliable?
Any help greatly appreciated, we're at our wits end.
Bob
Does it ever resolve itself, or once the connection is broken, it cannot
reconnect without restarting the program?!?
Could it be a DNS issue? Could it be that some of the VB6 applications are
not returning all of their resources properly?
I just throwing some ideas out there.
Rick Sawtell
MCT, MCSD, MCDBA
"RD" <nospam@.nospam.net> wrote in message
news:%23oouP$IsEHA.1816@.TK2MSFTNGP15.phx.gbl...
> Got a sql server 2000 unlimited user license running on a Dell Server (1
> CPU). There are several automated programs running 24 -7 that need to
access
> the database, each running on its own PC. Problem is the programs will run
> flawlessly for days and hours, connecting, doing their stuff, closing the
> connections (they are in VB6 or VB.NET). They all use the same connection
> strings and work with ADO OLEDB connections.
> Then all of a sudden on on or the other machine a program that needs to
> connect to the server will refuse to connect, with a valid connection
string
> (we trap it, its OK). The typical error we get back will be server not
> found, but if we ping the server either by its name or by IP address on
the
> computer that is giving us the error, we get a ping response back OK.
> We're looking at a possible hardware failure but then we can use the SQL
> database OK from within Enterprise Mgr, no problem.
> It does not make any sense. Has anyone come accross a similar situation,
> what can we do to make this more reliable?
> Any help greatly appreciated, we're at our wits end.
> Bob
>

Connections

I've got a third party download app that creates ten connections to Sql
Server 2000 per user! We've got an average of 40 users/day and so we have
around 400 connections floating around all day just for this one small app!
We asked the vendor and all they will say is "it's working as designed".
So here are my questions:
1. Is there ANY reason on planet earth, performance or otherwise, that
someone would require ten connections?!?
2. How can I get it across that this is unacceptable? How can I calculate
how many connections Sql Server can handle? Are there any rules of thumb
that I can use for leverage?
Thx.
CLM wrote:
> I've got a third party download app that creates ten connections to
> Sql Server 2000 per user! We've got an average of 40 users/day and
> so we have around 400 connections floating around all day just for
> this one small app! We asked the vendor and all they will say is
> "it's working as designed".
> So here are my questions:
> 1. Is there ANY reason on planet earth, performance or otherwise,
> that someone would require ten connections?!?
Possibly, but not likely.

> 2. How can I get it across that this is unacceptable? How can I
> calculate how many connections Sql Server can handle? Are there any
> rules of thumb that I can use for leverage?
>
Maybe you can turn on connection pooling in control panel if the app is
using ODBC connections to SQL Server. However, you may need to enable
connection pooling in the application using SQLSetEnvAttr and you
probably can't do this. ADO.Net provides connection pooling
automatically.
Maybe you can find out from the vendor if they support connection
pooling. Then send or email someone high up at the company (like the
CTO) your concerns about the product and the way it uses connections
very liberally.
Each connection consumes 12 KB + (3 * Network Packet Size). So, even
with 400 connections using a 4K packet size, you're only consuming about
10MB of memory.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Yes, but I've been reading that if Sql Server goes over 255 threads, Sql
Server will start to go over 2 connections per thread and resources will get
shared.
Plus, in addition to what you wrote, isn't Sql Server using some cpu
resources to manage these 400 inactive connections?
"David Gugick" wrote:

> CLM wrote:
> Possibly, but not likely.
>
> Maybe you can turn on connection pooling in control panel if the app is
> using ODBC connections to SQL Server. However, you may need to enable
> connection pooling in the application using SQLSetEnvAttr and you
> probably can't do this. ADO.Net provides connection pooling
> automatically.
> Maybe you can find out from the vendor if they support connection
> pooling. Then send or email someone high up at the company (like the
> CTO) your concerns about the product and the way it uses connections
> very liberally.
> Each connection consumes 12 KB + (3 * Network Packet Size). So, even
> with 400 connections using a 4K packet size, you're only consuming about
> 10MB of memory.
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>
|||CLM wrote:
> Yes, but I've been reading that if Sql Server goes over 255 threads,
> Sql Server will start to go over 2 connections per thread and
> resources will get shared.
If they're mostly idle, then you probably won't reach the default of 255
worker threads. Even if you do (it would require about 6+ active batches
run on each of your 40 clients), SQL Server will temporarily have
batches wait until a worker thread is available for use. From BOL:
"Having all worker threads allocated does not mean that the performance
of SQL Server will degrade. Typically, a new batch has only a short wait
for a free thread. Allocating more threads may degrade performance
because of the increased work required to coordinate resources among the
threads. Many SQL Server systems running in production reach this state
and run with very high performance levels."

> Plus, in addition to what you wrote, isn't Sql Server using some cpu
> resources to manage these 400 inactive connections?
Not much if they are inactive.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:7A9AD5AD-E23C-469F-B8C6-0124D2D2788C@.microsoft.com...
> Yes, but I've been reading that if Sql Server goes over 255 threads, Sql
> Server will start to go over 2 connections per thread and resources will
> get
> shared.
That's not true. Or rather, it's not relavent. A connection is assigned
not to a thread, but to a scheduler. Each scheduler has a pool of workers
(threads) to carry out work. So there is not a 1-1 relationship between the
number of connections and the number of threads on the server.

> Plus, in addition to what you wrote, isn't Sql Server using some cpu
> resources to manage these 400 inactive connections?
No.
David

Connections

I've got a third party download app that creates ten connections to Sql Server 2000 per user! We've got an average of 40 users/day and so we have around 400 connections floating around all day just for this one small app! We asked the vendor and all they will say is "it's working as designed".

So here are my questions:

1. Is there ANY reason on planet earth, performance or otherwise, that someone would require ten connections?!?
2. How can I get it across that this is unacceptable? How can I calculate how many connections Sql Server can handle? Are there any rules of thumb that I can use for leverage?

Thx.It is most probably not required. Typically it is efficient to make and break connections as required from the client side code. The driver/provider maintains a pool of connections anyway which will help in reuse of connections. This also means that you manage resources more efficiently on the client side. It is possible to leak connection resources if used incorrectly from client side and this may require frequent restarts of the application or bad performance over time. Some connections could also be orphaned both on client/server depending on the complexity of the application. So it is generally not a good idea to keep too many open connections from an application to SQL Server. And lastly, connections to take some resources on the server (see books online capacity specifications topic).

Connections

I've got a third party download app that creates ten connections to Sql
Server 2000 per user! We've got an average of 40 users/day and so we have
around 400 connections floating around all day just for this one small app!
We asked the vendor and all they will say is "it's working as designed".
So here are my questions:
1. Is there ANY reason on planet earth, performance or otherwise, that
someone would require ten connections?!?
2. How can I get it across that this is unacceptable? How can I calculate
how many connections Sql Server can handle? Are there any rules of thumb
that I can use for leverage?
Thx.CLM wrote:
> I've got a third party download app that creates ten connections to
> Sql Server 2000 per user! We've got an average of 40 users/day and
> so we have around 400 connections floating around all day just for
> this one small app! We asked the vendor and all they will say is
> "it's working as designed".
> So here are my questions:
> 1. Is there ANY reason on planet earth, performance or otherwise,
> that someone would require ten connections?!?
Possibly, but not likely.

> 2. How can I get it across that this is unacceptable? How can I
> calculate how many connections Sql Server can handle? Are there any
> rules of thumb that I can use for leverage?
>
Maybe you can turn on connection pooling in control panel if the app is
using ODBC connections to SQL Server. However, you may need to enable
connection pooling in the application using SQLSetEnvAttr and you
probably can't do this. ADO.Net provides connection pooling
automatically.
Maybe you can find out from the vendor if they support connection
pooling. Then send or email someone high up at the company (like the
CTO) your concerns about the product and the way it uses connections
very liberally.
Each connection consumes 12 KB + (3 * Network Packet Size). So, even
with 400 connections using a 4K packet size, you're only consuming about
10MB of memory.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Yes, but I've been reading that if Sql Server goes over 255 threads, Sql
Server will start to go over 2 connections per thread and resources will get
shared.
Plus, in addition to what you wrote, isn't Sql Server using some cpu
resources to manage these 400 inactive connections'
"David Gugick" wrote:

> CLM wrote:
> Possibly, but not likely.
>
> Maybe you can turn on connection pooling in control panel if the app is
> using ODBC connections to SQL Server. However, you may need to enable
> connection pooling in the application using SQLSetEnvAttr and you
> probably can't do this. ADO.Net provides connection pooling
> automatically.
> Maybe you can find out from the vendor if they support connection
> pooling. Then send or email someone high up at the company (like the
> CTO) your concerns about the product and the way it uses connections
> very liberally.
> Each connection consumes 12 KB + (3 * Network Packet Size). So, even
> with 400 connections using a 4K packet size, you're only consuming about
> 10MB of memory.
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>|||CLM wrote:
> Yes, but I've been reading that if Sql Server goes over 255 threads,
> Sql Server will start to go over 2 connections per thread and
> resources will get shared.
If they're mostly idle, then you probably won't reach the default of 255
worker threads. Even if you do (it would require about 6+ active batches
run on each of your 40 clients), SQL Server will temporarily have
batches wait until a worker thread is available for use. From BOL:
"Having all worker threads allocated does not mean that the performance
of SQL Server will degrade. Typically, a new batch has only a short wait
for a free thread. Allocating more threads may degrade performance
because of the increased work required to coordinate resources among the
threads. Many SQL Server systems running in production reach this state
and run with very high performance levels."

> Plus, in addition to what you wrote, isn't Sql Server using some cpu
> resources to manage these 400 inactive connections'
Not much if they are inactive.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:7A9AD5AD-E23C-469F-B8C6-0124D2D2788C@.microsoft.com...
> Yes, but I've been reading that if Sql Server goes over 255 threads, Sql
> Server will start to go over 2 connections per thread and resources will
> get
> shared.
That's not true. Or rather, it's not relavent. A connection is assigned
not to a thread, but to a scheduler. Each scheduler has a pool of workers
(threads) to carry out work. So there is not a 1-1 relationship between the
number of connections and the number of threads on the server.

> Plus, in addition to what you wrote, isn't Sql Server using some cpu
> resources to manage these 400 inactive connections'
No.
David

Connections

I've got a third party download app that creates ten connections to Sql
Server 2000 per user! We've got an average of 40 users/day and so we have
around 400 connections floating around all day just for this one small app!
We asked the vendor and all they will say is "it's working as designed".
So here are my questions:
1. Is there ANY reason on planet earth, performance or otherwise, that
someone would require ten connections?!?
2. How can I get it across that this is unacceptable? How can I calculate
how many connections Sql Server can handle? Are there any rules of thumb
that I can use for leverage?
Thx.CLM wrote:
> I've got a third party download app that creates ten connections to
> Sql Server 2000 per user! We've got an average of 40 users/day and
> so we have around 400 connections floating around all day just for
> this one small app! We asked the vendor and all they will say is
> "it's working as designed".
> So here are my questions:
> 1. Is there ANY reason on planet earth, performance or otherwise,
> that someone would require ten connections?!?
Possibly, but not likely.
> 2. How can I get it across that this is unacceptable? How can I
> calculate how many connections Sql Server can handle? Are there any
> rules of thumb that I can use for leverage?
>
Maybe you can turn on connection pooling in control panel if the app is
using ODBC connections to SQL Server. However, you may need to enable
connection pooling in the application using SQLSetEnvAttr and you
probably can't do this. ADO.Net provides connection pooling
automatically.
Maybe you can find out from the vendor if they support connection
pooling. Then send or email someone high up at the company (like the
CTO) your concerns about the product and the way it uses connections
very liberally.
Each connection consumes 12 KB + (3 * Network Packet Size). So, even
with 400 connections using a 4K packet size, you're only consuming about
10MB of memory.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Yes, but I've been reading that if Sql Server goes over 255 threads, Sql
Server will start to go over 2 connections per thread and resources will get
shared.
Plus, in addition to what you wrote, isn't Sql Server using some cpu
resources to manage these 400 inactive connections'
"David Gugick" wrote:
> CLM wrote:
> > I've got a third party download app that creates ten connections to
> > Sql Server 2000 per user! We've got an average of 40 users/day and
> > so we have around 400 connections floating around all day just for
> > this one small app! We asked the vendor and all they will say is
> > "it's working as designed".
> >
> > So here are my questions:
> >
> > 1. Is there ANY reason on planet earth, performance or otherwise,
> > that someone would require ten connections?!?
> Possibly, but not likely.
> > 2. How can I get it across that this is unacceptable? How can I
> > calculate how many connections Sql Server can handle? Are there any
> > rules of thumb that I can use for leverage?
> >
> Maybe you can turn on connection pooling in control panel if the app is
> using ODBC connections to SQL Server. However, you may need to enable
> connection pooling in the application using SQLSetEnvAttr and you
> probably can't do this. ADO.Net provides connection pooling
> automatically.
> Maybe you can find out from the vendor if they support connection
> pooling. Then send or email someone high up at the company (like the
> CTO) your concerns about the product and the way it uses connections
> very liberally.
> Each connection consumes 12 KB + (3 * Network Packet Size). So, even
> with 400 connections using a 4K packet size, you're only consuming about
> 10MB of memory.
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>|||CLM wrote:
> Yes, but I've been reading that if Sql Server goes over 255 threads,
> Sql Server will start to go over 2 connections per thread and
> resources will get shared.
If they're mostly idle, then you probably won't reach the default of 255
worker threads. Even if you do (it would require about 6+ active batches
run on each of your 40 clients), SQL Server will temporarily have
batches wait until a worker thread is available for use. From BOL:
"Having all worker threads allocated does not mean that the performance
of SQL Server will degrade. Typically, a new batch has only a short wait
for a free thread. Allocating more threads may degrade performance
because of the increased work required to coordinate resources among the
threads. Many SQL Server systems running in production reach this state
and run with very high performance levels."
> Plus, in addition to what you wrote, isn't Sql Server using some cpu
> resources to manage these 400 inactive connections'
Not much if they are inactive.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com|||"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:7A9AD5AD-E23C-469F-B8C6-0124D2D2788C@.microsoft.com...
> Yes, but I've been reading that if Sql Server goes over 255 threads, Sql
> Server will start to go over 2 connections per thread and resources will
> get
> shared.
That's not true. Or rather, it's not relavent. A connection is assigned
not to a thread, but to a scheduler. Each scheduler has a pool of workers
(threads) to carry out work. So there is not a 1-1 relationship between the
number of connections and the number of threads on the server.
> Plus, in addition to what you wrote, isn't Sql Server using some cpu
> resources to manage these 400 inactive connections'
No.
David

Sunday, March 11, 2012

Connection to SQL Server database

I keep on getting an error when I try to connect to my database throuh my ASP.NET WEb application. The error says login failed for user...

Initially I was using Windows Authentication with Impersonation turned on. This let me connect to the database no problem.

However, I decided to change my method of connecting to the database for performance reasons but now I get this error.

I store my connection string in web.config and it looks like this:


<appSettings>
<add key="ConnectionString" value="server=server;
Database=dbname;Connect Timeout=15;Network Library=dbmssocn;uid=username;password=userpassword"/>
</appSettings>

Further down in the web.config file I still have this:


<authentication mode="Windows" /
<authorization>
<allow users="nameofusergroup" />
<deny users="?" />
</authorization
<identity impersonate="true" />

Any ideas why I would be able to connect to the database using impersonation and not when I explicity give the crudentials in the connection string?

Regards

Wallaceprobably SQL Server isn't configured for SQL Authentication. just windows.

Thursday, March 8, 2012

Connection to sql server 2000

Hi, I've created database in sql server 2000 but how to i link it to
webpage for user to use as front end application ? Pls advise. Thanks

Rgds
DanielYou have to do some coding in the coding language of your choice.

-jens Suessmeyer.|||What language/ platform are you using?

--
Jack Vamvas
__________________________________________________ ________________
Receive free SQL tips - register at www.ciquery.com/sqlserver.htm
SQL Server Performance Audit - check www.ciquery.com/sqlserver_audit.htm
New article by Jack Vamvas - SQL and Markov Chains -
www.ciquery.com/articles/art_04.asp
<Danieltbt05@.gmail.com> wrote in message
news:1138725750.293962.191770@.g49g2000cwa.googlegr oups.com...
> Hi, I've created database in sql server 2000 but how to i link it to
> webpage for user to use as front end application ? Pls advise. Thanks
> Rgds
> Daniel|||Now using SQL Server 2000 on win2003 and using QA/enterprise manager
to connect in intranet now. Is it normal for user to connect to sql
server using QA or enterprise manager ? I mean do you consider it user
friendly ? So i intend to design it to become a webpage for end user to
view the data. I've been using DAO or ADO quite some time ago. is it ok
? what abt ODBC ? what do you recommend ? pls advise. thanks

Rgds
Daniel

Jack Vamvas wrote:
> What language/ platform are you using?
> --
> Jack Vamvas
> __________________________________________________ ________________
> Receive free SQL tips - register at www.ciquery.com/sqlserver.htm
> SQL Server Performance Audit - check www.ciquery.com/sqlserver_audit.htm
> New article by Jack Vamvas - SQL and Markov Chains -
> www.ciquery.com/articles/art_04.asp
> <Danieltbt05@.gmail.com> wrote in message
> news:1138725750.293962.191770@.g49g2000cwa.googlegr oups.com...
> > Hi, I've created database in sql server 2000 but how to i link it to
> > webpage for user to use as front end application ? Pls advise. Thanks
> > Rgds
> > Daniel|||ya correct but i not sure which language should i use. ADO, DAO or ODBC
? pls advise. Thanks|||(Danieltbt05@.gmail.com) writes:
> Now using SQL Server 2000 on win2003 and using QA/enterprise manager
> to connect in intranet now. Is it normal for user to connect to sql
> server using QA or enterprise manager ? I mean do you consider it user
> friendly ? So i intend to design it to become a webpage for end user to
> view the data. I've been using DAO or ADO quite some time ago. is it ok
> ? what abt ODBC ? what do you recommend ? pls advise. thanks

End-users normally don't use tools like Query Analyzer or Enterprise
Manager, but rather they access the database through an application
or a web page.

If I understand things right, you are looking into the latter. There
are several tools on the market: ASP, ASP .Net, Cold Fusion, and
probably more. I don't know any of them myself. Once you've chosen
a tool for your web site, then you have more or less also settled on
a client API. For ASP that would be ADO, for ASP .Net that would
be ADO .Net. (Which is very different from ADO, and also a lot better.)

I don't know if DAO can connect to SQL Server, but anyway that's really
old stuff that you should not use.

Sorry if the answer is not crystal clear, but this is not really the
best newsgrop to ask questions about building a web site.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Erland, if i want to build it into like VB do i have to use ASP or
others tools u mentioned ? Only ADO.net can be used in webpage ? DAO or
ADO cannot be used ? Anywhere can learn step by step of it whether
build into VB app. or webpage ? Thanks

Rgds
Daniel|||(Danieltbt05@.gmail.com) writes:
> Erland, if i want to build it into like VB do i have to use ASP or
> others tools u mentioned ? Only ADO.net can be used in webpage ? DAO or
> ADO cannot be used ? Anywhere can learn step by step of it whether
> build into VB app. or webpage ? Thanks

As I said, this is not really the right place to ask question on how to
build web pages.

But, no, ADO .Net is not sufficient. ADO .Net - as well as ADO and DAO - is
a client API for access data sources. For building a web site, you can
use ASP. Net or ASP. I believe that they use some variation of VB script,
but exactly what this ASP thing is, I'm quite in the dark myself. I would
recommend you to look for newsgroups with "aspnet" in the name.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Wednesday, March 7, 2012

connection to database ?

can i have multiple user and password in a connection string ??

for example :

<add name="strCon" connectionString="Data Source=test;Initial Catalog=test;User=test, guest;Password=test, guest" providerName="System.Data.SqlClient" />-

or is there any other way ??

the reason is that i have created a view that hits 2 database that requires user info and pass ...........any advice is appreciated

Just put two connection strings in your web.config and in the area that says add name="" give them separate names. In your datalayer you will have to allow for this. When it is calling from one database call the appropriate connection string. When it is the other use the second connection string.

I hope that this helps.|||thanks for the info...........

Saturday, February 25, 2012

Connection Timeout

Is there any configuration option that controls how long
a user stays connected to mssql server? I have an
application that logs into mssql server and then uses
that one login for all work never logging out, after
about 7 days(fairly consistently) the connection to the
mssql gets killed and the application has to be
restarted. I was just curious if there is some kind of
parameter within mssql server that kills logins after x
number of days?
Thanks,
CarlHi,
There is no parameter in SQL server which will kill the user after x number
of days.
Rather you can write ur own code based on the login_time in
master..sysprocesses table and compare with getdate() for each process id
available in the list.
If any of the SPID is older then x days you can use
KILL SPID to kill the user. SPID also you can take it from
master..sysprocesses tables
Thanks
Hari
MCDBA
"z-man" <anonymous@.discussions.microsoft.com> wrote in message
news:817d01c4076d$e655aa20$a601280a@.phx.gbl...
> Is there any configuration option that controls how long
> a user stays connected to mssql server? I have an
> application that logs into mssql server and then uses
> that one login for all work never logging out, after
> about 7 days(fairly consistently) the connection to the
> mssql gets killed and the application has to be
> restarted. I was just curious if there is some kind of
> parameter within mssql server that kills logins after x
> number of days?
> Thanks,
> Carl
>|||There isn't anything like that built into SQL Server. You
could write your own procedure to do something like that but
nothing built into SQL Server.
If the application is on PC, server other than SQL Server,
you may want to look into network connectivity issues. You
may want to check the event logs where the application is
and see if you can find any clues in the logs.
-Sue
On Thu, 11 Mar 2004 05:36:47 -0800, "z-man"
<anonymous@.discussions.microsoft.com> wrote:

>Is there any configuration option that controls how long
>a user stays connected to mssql server? I have an
>application that logs into mssql server and then uses
>that one login for all work never logging out, after
>about 7 days(fairly consistently) the connection to the
>mssql gets killed and the application has to be
>restarted. I was just curious if there is some kind of
>parameter within mssql server that kills logins after x
>number of days?
>Thanks,
>Carl|||There is a 2 hour tcp session timeout and 1 hour for name pipe sessions.
But, this is controlled by the OS, not SQL.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||That's a good point...and looking at the keepalive settings
could be an option. After thinking about it more and that if
this happens about every 7 days, it may more likely be
related to a weekly process or something similar that is
hosing the connection. I think I'd go through the logs and
look for activity around the time the connection gets hosed.
-Sue
On Thu, 11 Mar 2004 21:02:41 GMT, kevmc@.online.microsoft.com
(Kevin McDonnell [MSFT]) wrote:

>There is a 2 hour tcp session timeout and 1 hour for name pipe sessions.
>But, this is controlled by the OS, not SQL.
>Thanks,
>Kevin McDonnell
>Microsoft Corporation
>This posting is provided AS IS with no warranties, and confers no rights.
>

connection string with authenticated user info

Hi. New to ASP.NET and first time posting.

My web app connects to a SQL database - SQL authentication.

Users login to the web app through the login server control. Once authenticated, it is my understanding that the user name and password are stored on the client as a cookie.

How do you programmatically get this user info and use it for the userid and password parameters of the connection string?

Is there a better way to use the authenticated user info to access a SQL database?

Thanks

Once authenticated (using asp.net login control), you can get the user info programmatically using:

Page

.User.Identity ( for example,Page.User.Identity.Name returns the username )|||

Thanks for the info.

I did some reading on Page.User.Identity, but don't understand how to get the password used for login. I need both the username and password to authenticate in SQL server.

Friday, February 24, 2012

Connection String Help

Could someone please tell me where do I find out my "user" and "password" for my Sql Connection String. Also could someone tell me I'm using the right server name. I know the name of my server on my network. But I see different names in the SQL Server Enterprise Manager.You should be able to get your username and password from the DBA if it's a database server where you work. If it's hosted they usually give it to you in a setup confirmation email, if you didn't get one you can call their support line and they should be able to help you out.

Good luck.|||Where do I find the DBA?|||:) Oh dear that made me laugh (sorry). DBA is a person that owns the database. They're an elusive lot usually found in darken rooms muttering about DATs and watching re-runs of Star Trek ;) When we all know that Star Wars is far superior.|||That's good, lol.