Hi Trapulo,
This issue is quite strange. So I need more information on this.
1. What's the version and edition of your SQL server? Have you installed
enough licences on it?
2. Try to create two administrator accounts sa1 and sa2 in SQL server, and
logon with sa1 for the first application and sa2 for the second.
I'll make further research to help you resolve this problem.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
--------------------
| Reply-To: "Trapulo" <
[email protected]>
| From: "Trapulo" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| Subject: Re: very strange problem with connection
| Date: Mon, 20 Oct 2003 11:11:45 +0200
| Lines: 147
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: host130-10.pool80116.interbusiness.it 80.116.10.130
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:64040
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
|
| | > Hi Trapulo,
| >
| > I'm not quite sure how this happens due to lack of information. Would
you
| > please tell me if the two applications are on the same server?
|
| Yes of course. They are on two separate applications on the same web site.
|
| Can you try
| > the following to see if it can work?
| >
| > 1. Currently, you're using integrated security, would you change the
| > authentication to SQL authentication and login with the sa account for
| both
| > applications?
|
| I've tried, but is the same thing.
|
| > 2. Are you using connection pooling in SQL server? If yes, please
comfirm
| > the maximum connections allowed.
|
| Yes. But this is made with default configuration (I've not inserted
specific
| tag in connection string to enable or disable the pool), so I think all is
| the default behavior of ADO.NET..
|
| >
| > 3. Please close any connection after they are used in code.
|
| This is done.
|
|
| The only "strange" think I have in this application is that it doesn't use
| direct SQL Client, but generic OLEDB Provider (I know this is not the best
| way, but there is a reason) and this part of the application uses ADO with
| interop to read the data (it is an old module upgraded without porting to
| complete ado.net).
|
| The connection string is:
| Provider=SQLOLEDB;Trusted_Connection=yes;app=User_Application;data
| source=myserver\myinstance;DataBase=dbname;Persist Security Info=False;
|
| As I said, the connection works only for the first application to start.
|
|
|
| The code that is executed at application startup is:
|
| Public Function ValidateUser(ByVal login As String) As ADOR.Recordset
|
| Const mCode As String = "3020202"
|
| If Len(login) = 0 Then
|
| Err.Raise(vbObjectError + 601, mCode, "Parametri mancanti o non validi")
|
| End If
|
|
|
| On Error GoTo EH
|
|
|
| Dim conn As New ADODB.Connection()
|
| conn.ConnectionString = mConnString
|
| conn.Open()
|
| Dim cmd As New ADODB.Command()
|
| cmd.ActiveConnection = conn
|
| cmd.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc
|
| cmd.CommandText = "_usr_UserBYLOGIN_GET"
|
| cmd.Parameters.Append(cmd.CreateParameter("@login",
| ADOR.DataTypeEnum.adVarChar, ADODB.ParameterDirectionEnum.adParamInput,
15,
| login))
|
| ValidateUser = New ADOR.Recordset()
|
| ValidateUser.CursorLocation = ADOR.CursorLocationEnum.adUseClient
|
| ValidateUser.Open(cmd, , ADOR.CursorTypeEnum.adOpenForwardOnly,
| ADOR.LockTypeEnum.adLockReadOnly)
|
|
System.Runtime.InteropServices.Marshal.ReleaseComObject(ValidateUser.ActiveC
| onnection)
|
| ValidateUser.ActiveConnection = Nothing
|
| System.Runtime.InteropServices.Marshal.ReleaseComObject(cmd)
|
| cmd = Nothing
|
| conn.Close()
|
| System.Runtime.InteropServices.Marshal.ReleaseComObject(conn)
|
| conn = Nothing
|
|
|
| EH:
|
| If Not (cmd Is Nothing) Then
|
| System.Runtime.InteropServices.Marshal.ReleaseComObject(cmd)
|
| cmd = Nothing
|
| End If
|
| If Not (conn Is Nothing) Then
|
| conn.Close()
|
| System.Runtime.InteropServices.Marshal.ReleaseComObject(conn)
|
| conn = Nothing
|
| End If
|
|
|
| myLog.WriteEntry("Errore " & mAppName & ": User.Data_User.ValidateUser: "
&
| Err.Description & vbCrLf & "; " & "login=" & login,
EventLogEntryType.Error)
|
| If Err.Number = -2147217873 Then
|
| Err.Raise(vbObjectError + 602, mCode, Err.Description)
|
| Else
|
| Err.Raise(vbObjectError + 603, mCode, Err.Description)
|
| End If
|
|
|
|
|
|
|