Showing posts with label instance. Show all posts
Showing posts with label instance. Show all posts

Sunday, March 25, 2012

Connection Pooling.

I have created an instance of sqlconnection and using transaction i am executing 5 insert statements (Database - SQL Server 2005). I have the finally block where i call the dispose method of the transaction and close method of the connection object.I often get the below mentioned error:

Exception Type: System.InvalidOperationException

Message: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

TargetSite: System.Data.ProviderBase.DbConnectionInternal GetConnection(System.Data.Common.DbConnection)

Source: System.Data

How do i resolve the above issue?

do you a transaction.Commit()?

Put the code.

Regards.

PD:

this is a transaction example:

Code Snippet

using (dbcmd.Transaction = dbcon.BeginTransaction())

{

try

{

dbcmd.CommandText = string.Format(sql1, tablaDestino, sqlOrigen);

dbcmd.ExecuteNonQuery();

dbcmd.CommandText = string.Format(sql2, tablaDestino);

dbcmd.ExecuteNonQuery();

dbcmd.CommandText = string.Format(sql3, tablaDestino);

dbcmd.ExecuteNonQuery();

dbcmd.CommandText = string.Format(sql4, tablaDestino);

dbcmd.ExecuteNonQuery();

dbcmd.CommandText = string.Format(sql5, tablaDestino);

dbcmd.ExecuteNonQuery();

dbcmd.Transaction.Commit();

}

catch (DbException dbException)

{

dbcmd.Transaction.Rollback();

throw new PoolException("La transaci¢n de creaci¢n de pool ha fallado","CreatePool", 0, dbException);

}

}

|||

Yes, I am doing a commit. We are using DAAB SQLHelper class.

|||

You may try to increase the size of the connection pool. For example: Set Min Pool Size=10;Max Pool Size=1000 in your connection string

|||I have increased the connection pool size. min as 5 and max 100. still it gives me a problem.|||I've had simillar problem with the connection pooling. Have you made sure that the connection used is closed after you are finished with it.

I found loads of open connections within my code and closing them seams to have helped.

Colin
|||Yes i am closing the connection after using.|||

I don't think this has anything to do with connection pooling once the connection is open -- as soon as you open your connection, it's yours until you close the connection -- no other connection can use it until you close it.

Connection pooling doesn't utilise your physical connection for other logical connections while it's open -- it simply doesn't physically close connections when you close them and assigns those connections to new logical connections by client applications when required.

|||Note that you simply may not have enough connections in the pool initially. By default, the MaxPoolSize=100. Try increasing this by placing MaxPoolSize=500 in the connection string.

Connection Pooling.

I have created an instance of sqlconnection and using transaction i am executing 5 insert statements (Database - SQL Server 2005). I have the finally block where i call the dispose method of the transaction and close method of the connection object.I often get the below mentioned error:

Exception Type: System.InvalidOperationException

Message: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

TargetSite: System.Data.ProviderBase.DbConnectionInternal GetConnection(System.Data.Common.DbConnection)

Source: System.Data

How do i resolve the above issue?

do you a transaction.Commit()?

Put the code.

Regards.

PD:

this is a transaction example:

Code Snippet

using (dbcmd.Transaction = dbcon.BeginTransaction())

{

try

{

dbcmd.CommandText = string.Format(sql1, tablaDestino, sqlOrigen);

dbcmd.ExecuteNonQuery();

dbcmd.CommandText = string.Format(sql2, tablaDestino);

dbcmd.ExecuteNonQuery();

dbcmd.CommandText = string.Format(sql3, tablaDestino);

dbcmd.ExecuteNonQuery();

dbcmd.CommandText = string.Format(sql4, tablaDestino);

dbcmd.ExecuteNonQuery();

dbcmd.CommandText = string.Format(sql5, tablaDestino);

dbcmd.ExecuteNonQuery();

dbcmd.Transaction.Commit();

}

catch (DbException dbException)

{

dbcmd.Transaction.Rollback();

throw new PoolException("La transaci¢n de creaci¢n de pool ha fallado","CreatePool", 0, dbException);

}

}

|||

Yes, I am doing a commit. We are using DAAB SQLHelper class.

|||

You may try to increase the size of the connection pool. For example: Set Min Pool Size=10;Max Pool Size=1000 in your connection string

|||I have increased the connection pool size. min as 5 and max 100. still it gives me a problem.|||I've had simillar problem with the connection pooling. Have you made sure that the connection used is closed after you are finished with it.

I found loads of open connections within my code and closing them seams to have helped.

Colin
|||Yes i am closing the connection after using.|||

I don't think this has anything to do with connection pooling once the connection is open -- as soon as you open your connection, it's yours until you close the connection -- no other connection can use it until you close it.

Connection pooling doesn't utilise your physical connection for other logical connections while it's open -- it simply doesn't physically close connections when you close them and assigns those connections to new logical connections by client applications when required.

|||Note that you simply may not have enough connections in the pool initially. By default, the MaxPoolSize=100. Try increasing this by placing MaxPoolSize=500 in the connection string.

Tuesday, March 20, 2012

Connection no longer works

I was able to connect to a SQL Server 2000 instance using ODBC on a Windows
2000 workstation (Service Pack 4). But after installing several security
updates and rollups, I am no longer able to connect to SQL Server.
The drivers tab in the ODBC Administrator lists SQL Server as Not marked
under Version and Company. Another machine that was not as updated lists
Version as 3.70.06.90 and Company as Microsoft.
Have you run component checker to verify your MDAC
installation? You could also try reinstalling MDAC - sounds
like the issue is likely with once of the MDAC components.
You can download component checker and mdac versions from:
http://msdn.microsoft.com/data/mdac/...s/default.aspx
-Sue
On Mon, 3 Oct 2005 10:42:01 -0700, "Alton Chinn" <Alton
Chinn@.discussions.microsoft.com> wrote:

>I was able to connect to a SQL Server 2000 instance using ODBC on a Windows
>2000 workstation (Service Pack 4). But after installing several security
>updates and rollups, I am no longer able to connect to SQL Server.
>The drivers tab in the ODBC Administrator lists SQL Server as Not marked
>under Version and Company. Another machine that was not as updated lists
>Version as 3.70.06.90 and Company as Microsoft.
|||I used it to determine that the various windows updates and hotfixes may have
knocked my MDAC version down to 2.5 SP3. For the SQL Server connection to
work, the version has to be at least 2.6 RTM, I think.
I tried to bring the version up to 2.8 but the rollback would always fail.
I tried to rename ODBCCONF.DLL and run unmgrt, then re-run mdac_type, but
that did not seem to work.
Alton
"Sue Hoegemeier" wrote:

> Have you run component checker to verify your MDAC
> installation? You could also try reinstalling MDAC - sounds
> like the issue is likely with once of the MDAC components.
> You can download component checker and mdac versions from:
> http://msdn.microsoft.com/data/mdac/...s/default.aspx
> -Sue
> On Mon, 3 Oct 2005 10:42:01 -0700, "Alton Chinn" <Alton
> Chinn@.discussions.microsoft.com> wrote:
>
>
|||You're going to have to get that MDAC updated. Don't try a rollback. Just
install the latest MDAC over the top. If you get an error try rebooting. If
that doesn't work, post the error and we'll help you out from there.
MeanOldDBA
derrickleggett@.hotmail.com
http://weblogs.sqlteam.com/derrickl
When life gives you a lemon, fire the DBA.
"Alton Chinn" wrote:
[vbcol=seagreen]
> I used it to determine that the various windows updates and hotfixes may have
> knocked my MDAC version down to 2.5 SP3. For the SQL Server connection to
> work, the version has to be at least 2.6 RTM, I think.
> I tried to bring the version up to 2.8 but the rollback would always fail.
> I tried to rename ODBCCONF.DLL and run unmgrt, then re-run mdac_type, but
> that did not seem to work.
> Alton
> "Sue Hoegemeier" wrote:
|||I tried running mdac_type.exe for version 2.8 sp1. After copying the new
files, it starts rolling back components automatically. Then I get a message
saying the setup failed to complete. After restarting, I ran the checker and
it lists the verison as 2.5 sp3.
Alton
"MeanOldDBA" wrote:
[vbcol=seagreen]
> You're going to have to get that MDAC updated. Don't try a rollback. Just
> install the latest MDAC over the top. If you get an error try rebooting. If
> that doesn't work, post the error and we'll help you out from there.
> --
> MeanOldDBA
> derrickleggett@.hotmail.com
> http://weblogs.sqlteam.com/derrickl
> When life gives you a lemon, fire the DBA.
>
> "Alton Chinn" wrote:
|||First try reading through the MDAC setup troubleshooting
guide:
http://support.microsoft.com/?id=232060
Typically you get more information in the error than just
setup failed to complete - that may provide more pointers to
what is going on.
I remember an issue with automatic rollbacks with other
versions of MDAC - see the info in the following:
http://support.microsoft.com/?id=286442
You may want to check the event logs to see if you have
something similar going on.
-Sue
On Tue, 4 Oct 2005 11:22:02 -0700, "Alton Chinn"
<AltonChinn@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>I tried running mdac_type.exe for version 2.8 sp1. After copying the new
>files, it starts rolling back components automatically. Then I get a message
>saying the setup failed to complete. After restarting, I ran the checker and
>it lists the verison as 2.5 sp3.
>Alton
>
>"MeanOldDBA" wrote:
|||According to dasetup, installation fails at the ODBC configuration:
************************************************** *****
ODBCConf called with arguments: '/S /Lv C:\WINNT\dasetup.log /F
C:\WINNT\system32\sqlclnt.rsp'
Data Struct:
Reboot First : 0
Use Response File : 1
Response File : 'C:\WINNT\system32\sqlclnt.rsp'
Erase Response File: 0
Silent : 1
Continue on Error : 0
Log Mode : 2
Log File : 'C:\WINNT\dasetup.log'
Actions:
5, 'SQL Server|Driver=SQLSRV32.dll||', '(null)', '"SQL
Server|Driver=SQLSRV32.dll||"'
1, 'SQL Server', 'CPTimeout=60', '"SQL Server" "CPTimeout=60"'
2, 'SQL Server', 'DSN=MQIS|Server=(Local)|Description=SQL
Server|Database=MQIS||', '"SQL Server"
"DSN=MQIS|Server=(Local)|Description=SQL Server|Database=MQIS||"'
EXECUTING ACTIONS
Executing Action: INSTALLDRIVER
arg1: 'SQL Server|Driver=SQLSRV32.dll||'
arg2: '(null)'
args: '"SQL Server|Driver=SQLSRV32.dll||"'
INSTALLDRIVER SQLInstallDriverEx succeeded
Return HR: 0x0
Executing Action: CONFIGDRIVER
arg1: 'SQL Server'
arg2: 'CPTimeout=60'
args: '"SQL Server" "CPTimeout=60"'
CONFIGDRIVER SQLConfigDriver succeeded
Return HR: 0x0
Executing Action: CONFIGDSN
arg1: 'SQL Server'
arg2: 'DSN=MQIS|Server=(Local)|Description=SQL Server|Database=MQIS||'
args: '"SQL Server" "DSN=MQIS|Server=(Local)|Description=SQL
Server|Database=MQIS||"'
CONFIGDSN Unable to create a data source for the 'SQL Server' driver:
Could not load the setup or translator library
Return HR: 0x80004005
Error Executing Action: CONFIGDSN
Unable to create a data source for the 'SQL Server' driver:
Could not load the setup or translator library with error code -2147467259
Debug: Loaded string resource: 4. Characters = 23
Debug: Loaded string resource: 6. Characters = 16
Calling function: RestoreCatalog
RestoreCatalog: Success.
Entering function: ExecuteInstall()
Parameters:
nDirective = 5
hWnd = 0x00090042
pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLODB C.INF
pwcsCabFile = (null)
pwcsSection = DefaultInstall
pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
dwSetupFlags = 64
pContext = 0x0012B450
************************************************** *****
After that, the program starts to execute UNREGW2KMIGRATION.
|||Don't know what else to tell you. If you get an error, it
should be listed in the bottom of the log you posted -
that's the relevant part - where it goes into the
Entering function: ExecuteInstall()
-Sue
On Wed, 5 Oct 2005 10:26:14 -0700, "Alton Chinn"
<AltonChinn@.discussions.microsoft.com> wrote:

>According to dasetup, installation fails at the ODBC configuration:
>************************************************* ******
>ODBCConf called with arguments: '/S /Lv C:\WINNT\dasetup.log /F
>C:\WINNT\system32\sqlclnt.rsp'
>Data Struct:
>Reboot First : 0
>Use Response File : 1
>Response File : 'C:\WINNT\system32\sqlclnt.rsp'
>Erase Response File: 0
>Silent : 1
>Continue on Error : 0
>Log Mode : 2
>Log File : 'C:\WINNT\dasetup.log'
>Actions:
>5, 'SQL Server|Driver=SQLSRV32.dll||', '(null)', '"SQL
>Server|Driver=SQLSRV32.dll||"'
>1, 'SQL Server', 'CPTimeout=60', '"SQL Server" "CPTimeout=60"'
>2, 'SQL Server', 'DSN=MQIS|Server=(Local)|Description=SQL
>Server|Database=MQIS||', '"SQL Server"
>"DSN=MQIS|Server=(Local)|Description=SQL Server|Database=MQIS||"'
>EXECUTING ACTIONS
>Executing Action: INSTALLDRIVER
> arg1: 'SQL Server|Driver=SQLSRV32.dll||'
> arg2: '(null)'
> args: '"SQL Server|Driver=SQLSRV32.dll||"'
>INSTALLDRIVER SQLInstallDriverEx succeeded
> Return HR: 0x0
>Executing Action: CONFIGDRIVER
> arg1: 'SQL Server'
> arg2: 'CPTimeout=60'
> args: '"SQL Server" "CPTimeout=60"'
>CONFIGDRIVER SQLConfigDriver succeeded
> Return HR: 0x0
>Executing Action: CONFIGDSN
> arg1: 'SQL Server'
> arg2: 'DSN=MQIS|Server=(Local)|Description=SQL Server|Database=MQIS||'
> args: '"SQL Server" "DSN=MQIS|Server=(Local)|Description=SQL
>Server|Database=MQIS||"'
>CONFIGDSN Unable to create a data source for the 'SQL Server' driver:
>Could not load the setup or translator library
> Return HR: 0x80004005
>Error Executing Action: CONFIGDSN
>Unable to create a data source for the 'SQL Server' driver:
>Could not load the setup or translator library with error code -2147467259
>Debug: Loaded string resource: 4. Characters = 23
>Debug: Loaded string resource: 6. Characters = 16
>Calling function: RestoreCatalog
>RestoreCatalog: Success.
>Entering function: ExecuteInstall()
>Parameters:
>nDirective = 5
>hWnd = 0x00090042
>pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLODB C.INF
>pwcsCabFile = (null)
>pwcsSection = DefaultInstall
>pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
>dwSetupFlags = 64
>pContext = 0x0012B450
>************************************************* ******
>After that, the program starts to execute UNREGW2KMIGRATION.
>
|||HERE ARE THE VARIOUS CALLS TO ExecuteFunction():
Entering function: CJob::InitializeJobQueues()
Parameters:
hHive = 0x80000002
szRoot = Software\Microsoft\dasetup\jobs
Exiting function: CJob::InitializeJobQueues()
Return value: (HRESULT) 0x00000000
Debug: Loaded string resource: 3. Characters = 21
Debug: Loaded string resource: 5. Characters = 14
Calling function: BackupCatalog
BackupCatalog Result : Backup Catalog directory already exists for this
component.
Entering function: ExecuteInstall()
Parameters:
nDirective = 4
hWnd = 0x0004014C
pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\MDACXP AK.INF
pwcsCabFile = (null)
pwcsSection = DefaultInstall
pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
dwSetupFlags = 32
pContext = 0x0012B450
INSTALLW2KMIGRATIONPACK Getting OS Version Info
INSTALLW2KMIGRATIONPACK Testing
C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\MDACXP AK.INF for existance
INSTALLW2KMIGRATIONPACK Get the ComponentID
INSTALLW2KMIGRATIONPACK Setting SysSetup Function Pointers
INSTALLW2KMIGRATIONPACK HINSTANCE: 1727987712
INSTALLW2KMIGRATIONPACK SetupRegisterOsComponent ProcAddress: 1728218877
INSTALLW2KMIGRATIONPACK SetupUnRegisterOsComponent ProcAddress: 1728219747
INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent ProcAddress:
1728220575
INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
************
Executing Action: REGTYPELIB
arg1: 'simpdata.tlb'
arg2: '(null)'
args: '"simpdata.tlb"'
Return HR: 0x0
Debug: Loaded string resource: 3. Characters = 21
Debug: Loaded string resource: 5. Characters = 14
Calling function: BackupCatalog
BackupCatalog Result : Backup Catalog directory already exists for this
component.
Entering function: ExecuteInstall()
Parameters:
nDirective = 4
hWnd = 0x0004014C
pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\MSXMLX .inf
pwcsCabFile = (null)
pwcsSection = DefaultInstall
pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
dwSetupFlags = 32
pContext = 0x0012B450
INSTALLW2KMIGRATIONPACK Getting OS Version Info
INSTALLW2KMIGRATIONPACK Testing
C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\MSXMLX .inf for existance
INSTALLW2KMIGRATIONPACK Get the ComponentID
INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
*************
Calling function: BackupCatalog
BackupCatalog Result : Backup Catalog directory already exists for this
component.
Entering function: ExecuteInstall()
Parameters:
nDirective = 4
hWnd = 0x0004014C
pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLXML XP.inf
pwcsCabFile = (null)
pwcsSection = DefaultInstall
pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
dwSetupFlags = 32
pContext = 0x0012B450
INSTALLW2KMIGRATIONPACK Getting OS Version Info
INSTALLW2KMIGRATIONPACK Testing
C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLXML XP.inf for existance
INSTALLW2KMIGRATIONPACK Get the ComponentID
INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
*************
Calling function: BackupCatalog
BackupCatalog Result : Backup Catalog directory already exists for this
component.
Entering function: ExecuteInstall()
Parameters:
nDirective = 4
hWnd = 0x0004014C
pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLNET .INF
pwcsCabFile = (null)
pwcsSection = DefaultInstall
pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
dwSetupFlags = 32
pContext = 0x0012B450
INSTALLW2KMIGRATIONPACK Getting OS Version Info
INSTALLW2KMIGRATIONPACK Testing
C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLNET .INF for existance
INSTALLW2KMIGRATIONPACK Get the ComponentID
INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
**************
Calling function: BackupCatalog
BackupCatalog Result : Backup Catalog directory already exists for this
component.
Entering function: ExecuteInstall()
Parameters:
nDirective = 4
hWnd = 0x0004014C
pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLODB C.INF
pwcsCabFile = (null)
pwcsSection = DefaultInstall
pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
dwSetupFlags = 32
pContext = 0x0012B450
INSTALLW2KMIGRATIONPACK Getting OS Version Info
INSTALLW2KMIGRATIONPACK Testing
C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLODB C.INF for existance
INSTALLW2KMIGRATIONPACK Get the ComponentID
INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
***************
|||Don't know...looks like you have other issues related to the
OS.
-Sue
On Tue, 11 Oct 2005 11:52:03 -0700, "Alton Chinn"
<AltonChinn@.discussions.microsoft.com> wrote:

>HERE ARE THE VARIOUS CALLS TO ExecuteFunction():
>Entering function: CJob::InitializeJobQueues()
>Parameters:
>hHive = 0x80000002
>szRoot = Software\Microsoft\dasetup\jobs
>Exiting function: CJob::InitializeJobQueues()
>Return value: (HRESULT) 0x00000000
>Debug: Loaded string resource: 3. Characters = 21
>Debug: Loaded string resource: 5. Characters = 14
>Calling function: BackupCatalog
>BackupCatalog Result : Backup Catalog directory already exists for this
>component.
>Entering function: ExecuteInstall()
>Parameters:
>nDirective = 4
>hWnd = 0x0004014C
>pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\MDACXP AK.INF
>pwcsCabFile = (null)
>pwcsSection = DefaultInstall
>pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
>dwSetupFlags = 32
>pContext = 0x0012B450
>INSTALLW2KMIGRATIONPACK Getting OS Version Info
>INSTALLW2KMIGRATIONPACK Testing
>C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\MDACX PAK.INF for existance
>INSTALLW2KMIGRATIONPACK Get the ComponentID
>INSTALLW2KMIGRATIONPACK Setting SysSetup Function Pointers
>INSTALLW2KMIGRATIONPACK HINSTANCE: 1727987712
>INSTALLW2KMIGRATIONPACK SetupRegisterOsComponent ProcAddress: 1728218877
>INSTALLW2KMIGRATIONPACK SetupUnRegisterOsComponent ProcAddress: 1728219747
>INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent ProcAddress:
>1728220575
>INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
>************
>Executing Action: REGTYPELIB
> arg1: 'simpdata.tlb'
> arg2: '(null)'
> args: '"simpdata.tlb"'
> Return HR: 0x0
>Debug: Loaded string resource: 3. Characters = 21
>Debug: Loaded string resource: 5. Characters = 14
>Calling function: BackupCatalog
>BackupCatalog Result : Backup Catalog directory already exists for this
>component.
>Entering function: ExecuteInstall()
>Parameters:
>nDirective = 4
>hWnd = 0x0004014C
>pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\MSXMLX .inf
>pwcsCabFile = (null)
>pwcsSection = DefaultInstall
>pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
>dwSetupFlags = 32
>pContext = 0x0012B450
>INSTALLW2KMIGRATIONPACK Getting OS Version Info
>INSTALLW2KMIGRATIONPACK Testing
>C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\MSXML X.inf for existance
>INSTALLW2KMIGRATIONPACK Get the ComponentID
>INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
>*************
>Calling function: BackupCatalog
>BackupCatalog Result : Backup Catalog directory already exists for this
>component.
>Entering function: ExecuteInstall()
>Parameters:
>nDirective = 4
>hWnd = 0x0004014C
>pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLXML XP.inf
>pwcsCabFile = (null)
>pwcsSection = DefaultInstall
>pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
>dwSetupFlags = 32
>pContext = 0x0012B450
>INSTALLW2KMIGRATIONPACK Getting OS Version Info
>INSTALLW2KMIGRATIONPACK Testing
>C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLXM LXP.inf for existance
>INSTALLW2KMIGRATIONPACK Get the ComponentID
>INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
>*************
>Calling function: BackupCatalog
>BackupCatalog Result : Backup Catalog directory already exists for this
>component.
>Entering function: ExecuteInstall()
>Parameters:
>nDirective = 4
>hWnd = 0x0004014C
>pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLNET .INF
>pwcsCabFile = (null)
>pwcsSection = DefaultInstall
>pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
>dwSetupFlags = 32
>pContext = 0x0012B450
>INSTALLW2KMIGRATIONPACK Getting OS Version Info
>INSTALLW2KMIGRATIONPACK Testing
>C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLNE T.INF for existance
>INSTALLW2KMIGRATIONPACK Get the ComponentID
>INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
>**************
>Calling function: BackupCatalog
>BackupCatalog Result : Backup Catalog directory already exists for this
>component.
>Entering function: ExecuteInstall()
>Parameters:
>nDirective = 4
>hWnd = 0x0004014C
>pwcsInfFile = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLODB C.INF
>pwcsCabFile = (null)
>pwcsSection = DefaultInstall
>pwcsExtractPath = C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP
>dwSetupFlags = 32
>pContext = 0x0012B450
>INSTALLW2KMIGRATIONPACK Getting OS Version Info
>INSTALLW2KMIGRATIONPACK Testing
>C:\DOCUME~1\achinn\LOCALS~1\Temp\IXP000.TMP\SQLOD BC.INF for existance
>INSTALLW2KMIGRATIONPACK Get the ComponentID
>INSTALLW2KMIGRATIONPACK SetupQueryRegisteredOsComponent Failed with Error : 2
>***************
>
sqlsql

Monday, March 19, 2012

connection issues when running multiple instances of same application

I am running multiple instance of the same application. This application is connecting to the database and running stored procedures using ADODB (all code examples are taken from msado15).

The problem is that somehow these two applications are sharing something either with the connection or commands.

For instance if the two instances are in the following function at the same time then they both thow an SEH exception:

Code Snippet

inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) {

struct _Recordset * _result = 0;

HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

return _RecordsetPtr(_result, false);

}

The exception that occurs is: "First-chance exception ...: 0xC0000005: Access violation reading location 0x00000068."

And afterwords when they go to release the command an error occurs on

First-chance exception at 0x4de4120c in IpsEngine.exe: 0xC0000005: Access violation reading location 0xcccccccc.

Code Snippet

inline void _bstr_t::Data_t::_Free() throw()

{

if (m_wstr != NULL) {

::SysFreeString(m_wstr);

}

if (m_str != NULL) {

delete [] m_str;

}

}

This is being called from.

Code Snippet

inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) {

HRESULT _hr = putref_ActiveConnection(ppvObject);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

}

The exception that occurs: First-chance exception at ...: 0xC0000005: Access violation reading location 0xcccccccc.

Similarly when one instance releases a command using

Code Snippet

inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) {

HRESULT _hr = putref_ActiveConnection(ppvObject);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

}

The second instance of the application fails when running the command at the exact same time.

Code Snippet

inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) {

struct _Recordset * _result = 0;

HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

return _RecordsetPtr(_result, false);

}

The command and connections are not static and there should be completely seperate instances of these for each instance of the application. Does anybody know why this may be happening. Any help would be appreciated. Thanks in advance.

All of these access issues are with pointers being passed into these functions. As such, we don't have much context with which to help you with these issues. Any issue could be causing these problems including: double freeing, not allocating memory elsewhere or failure to properly initialize memory, failure to check return codes of functions that return memory, etc. In these cases, we need to see the context surrounding the variables that are causing the AV, in for example: for Command15::Execute, RecordsAffected and Parameters would be the variables of interest, we would need to see how they are allocated, initialized, and used prior to this function call in the execution context of a failure, and how they are allocated, initialized, and used prior to this function call in the execution context of success. The most likely cause of this AV is failure to handle error conditions coming back from functions that allocate memory on success.

Thanks,

John

|||

But when I run only one instance of the application at a time it works fine, I have been running it already for a long time and never had a problem. How is it that running two seperate instances of the application could cause this error. The memory allocation would not change just because there are two instances? would it?

connection issues when running multiple instances of same application

I am running multiple instance of the same application. This application is connecting to the database and running stored procedures using ADODB (all code examples are taken from msado15).

The problem is that somehow these two applications are sharing something either with the connection or commands.

For instance if the two instances are in the following function at the same time then they both thow an SEH exception:

Code Snippet

inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) {

struct _Recordset * _result = 0;

HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

return _RecordsetPtr(_result, false);

}

The exception that occurs is: "First-chance exception ...: 0xC0000005: Access violation reading location 0x00000068."

And afterwords when they go to release the command an error occurs on

First-chance exception at 0x4de4120c in IpsEngine.exe: 0xC0000005: Access violation reading location 0xcccccccc.

Code Snippet

inline void _bstr_t::Data_t::_Free() throw()

{

if (m_wstr != NULL) {

::SysFreeString(m_wstr);

}

if (m_str != NULL) {

delete [] m_str;

}

}

This is being called from.

Code Snippet

inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) {

HRESULT _hr = putref_ActiveConnection(ppvObject);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

}

The exception that occurs: First-chance exception at ...: 0xC0000005: Access violation reading location 0xcccccccc.

Similarly when one instance releases a command using

Code Snippet

inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) {

HRESULT _hr = putref_ActiveConnection(ppvObject);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

}

The second instance of the application fails when running the command at the exact same time.

Code Snippet

inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) {

struct _Recordset * _result = 0;

HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

return _RecordsetPtr(_result, false);

}

The command and connections are not static and there should be completely seperate instances of these for each instance of the application. Does anybody know why this may be happening. Any help would be appreciated. Thanks in advance.

All of these access issues are with pointers being passed into these functions. As such, we don't have much context with which to help you with these issues. Any issue could be causing these problems including: double freeing, not allocating memory elsewhere or failure to properly initialize memory, failure to check return codes of functions that return memory, etc. In these cases, we need to see the context surrounding the variables that are causing the AV, in for example: for Command15::Execute, RecordsAffected and Parameters would be the variables of interest, we would need to see how they are allocated, initialized, and used prior to this function call in the execution context of a failure, and how they are allocated, initialized, and used prior to this function call in the execution context of success. The most likely cause of this AV is failure to handle error conditions coming back from functions that allocate memory on success.

Thanks,

John

|||

But when I run only one instance of the application at a time it works fine, I have been running it already for a long time and never had a problem. How is it that running two seperate instances of the application could cause this error. The memory allocation would not change just because there are two instances? would it?

Connection issue with named instance

Hi all,
Since the replacement of new client workstation I've trouble for connection
of these new machines ot My different SQL Servers. On this configuration we
only speak of client/server connected on the same LAN without any antivirus
enabled.
When my users hae their new PC's (W2K - MDAC 2.6 SP1), they try to connect
to my server via for example ODBC and in this case when they browse network
they can't see named instance (only default instance is displayed (port 1433)
!). Next to it if they force the name in the connection string they still
can't connect ot the server, because of the port resolution. My workaround
today is to force the port in the connection string of each client (quite
heavy, 2500 workstations !!!) On my servers I have TCP/IP and Named Pipes
enable.
I've performed different test of connection (telnet 1433 work, PortQRY
return that 1433 and 1434 are working (but it didn't return all the instances
name), ping OK, tracert ok,...)
Any help would be appreciated, thanks in advance
SylvainCan you please follow below links and let us know if it was helpful for you.
http://sqljunkies.com/How%20To/2E1101E0-D5C1-4DBD-A398-FE485DFA439B.scuk
&
http://support.microsoft.com/default.aspx?scid=kb;en-us;287932
Regards
Surajit
"Sylvain" wrote:
> Hi all,
> Since the replacement of new client workstation I've trouble for connection
> of these new machines ot My different SQL Servers. On this configuration we
> only speak of client/server connected on the same LAN without any antivirus
> enabled.
> When my users hae their new PC's (W2K - MDAC 2.6 SP1), they try to connect
> to my server via for example ODBC and in this case when they browse network
> they can't see named instance (only default instance is displayed (port 1433)
> !). Next to it if they force the name in the connection string they still
> can't connect ot the server, because of the port resolution. My workaround
> today is to force the port in the connection string of each client (quite
> heavy, 2500 workstations !!!) On my servers I have TCP/IP and Named Pipes
> enable.
> I've performed different test of connection (telnet 1433 work, PortQRY
> return that 1433 and 1434 are working (but it didn't return all the instances
> name), ping OK, tracert ok,...)
> Any help would be appreciated, thanks in advance
> Sylvain|||Thanks for your reply.
Concerning the first link, after checking all cases the result is the same
than before, the only workaround is to create an alias (force port number).
All my clients even set on dynamically determine port, can't find an instance
other than the default except if I set manually the expected port by the
server.
For the second link, after checking with my network team we have validate
that no firewall are placed between clients and servers.
Thanks for your help
Sylvain
"surajits" wrote:
> Can you please follow below links and let us know if it was helpful for you.
> http://sqljunkies.com/How%20To/2E1101E0-D5C1-4DBD-A398-FE485DFA439B.scuk
> &
> http://support.microsoft.com/default.aspx?scid=kb;en-us;287932
>
> Regards
> Surajit
>
>
> "Sylvain" wrote:
> > Hi all,
> >
> > Since the replacement of new client workstation I've trouble for connection
> > of these new machines ot My different SQL Servers. On this configuration we
> > only speak of client/server connected on the same LAN without any antivirus
> > enabled.
> > When my users hae their new PC's (W2K - MDAC 2.6 SP1), they try to connect
> > to my server via for example ODBC and in this case when they browse network
> > they can't see named instance (only default instance is displayed (port 1433)
> > !). Next to it if they force the name in the connection string they still
> > can't connect ot the server, because of the port resolution. My workaround
> > today is to force the port in the connection string of each client (quite
> > heavy, 2500 workstations !!!) On my servers I have TCP/IP and Named Pipes
> > enable.
> > I've performed different test of connection (telnet 1433 work, PortQRY
> > return that 1433 and 1434 are working (but it didn't return all the instances
> > name), ping OK, tracert ok,...)
> >
> > Any help would be appreciated, thanks in advance
> > Sylvain

Connection issue with named instance

Hi all,
Since the replacement of new client workstation I've trouble for connection
of these new machines ot My different SQL Servers. On this configuration we
only speak of client/server connected on the same LAN without any antivirus
enabled.
When my users hae their new PC's (W2K - MDAC 2.6 SP1), they try to connect
to my server via for example ODBC and in this case when they browse network
they can't see named instance (only default instance is displayed (port 1433)
!). Next to it if they force the name in the connection string they still
can't connect ot the server, because of the port resolution. My workaround
today is to force the port in the connection string of each client (quite
heavy, 2500 workstations !!!) On my servers I have TCP/IP and Named Pipes
enable.
I've performed different test of connection (telnet 1433 work, PortQRY
return that 1433 and 1434 are working (but it didn't return all the instances
name), ping OK, tracert ok,...)
Any help would be appreciated, thanks in advance
Sylvain
Can you please follow below links and let us know if it was helpful for you.
http://sqljunkies.com/How%20To/2E110...85DFA439B.scuk
&
http://support.microsoft.com/default...b;en-us;287932
Regards
Surajit
"Sylvain" wrote:

> Hi all,
> Since the replacement of new client workstation I've trouble for connection
> of these new machines ot My different SQL Servers. On this configuration we
> only speak of client/server connected on the same LAN without any antivirus
> enabled.
> When my users hae their new PC's (W2K - MDAC 2.6 SP1), they try to connect
> to my server via for example ODBC and in this case when they browse network
> they can't see named instance (only default instance is displayed (port 1433)
> !). Next to it if they force the name in the connection string they still
> can't connect ot the server, because of the port resolution. My workaround
> today is to force the port in the connection string of each client (quite
> heavy, 2500 workstations !!!) On my servers I have TCP/IP and Named Pipes
> enable.
> I've performed different test of connection (telnet 1433 work, PortQRY
> return that 1433 and 1434 are working (but it didn't return all the instances
> name), ping OK, tracert ok,...)
> Any help would be appreciated, thanks in advance
> Sylvain
|||Thanks for your reply.
Concerning the first link, after checking all cases the result is the same
than before, the only workaround is to create an alias (force port number).
All my clients even set on dynamically determine port, can't find an instance
other than the default except if I set manually the expected port by the
server.
For the second link, after checking with my network team we have validate
that no firewall are placed between clients and servers.
Thanks for your help
Sylvain
"surajits" wrote:
[vbcol=seagreen]
> Can you please follow below links and let us know if it was helpful for you.
> http://sqljunkies.com/How%20To/2E110...85DFA439B.scuk
> &
> http://support.microsoft.com/default...b;en-us;287932
>
> Regards
> Surajit
>
>
> "Sylvain" wrote:

Connection issue with named instance

Hi all,
Since the replacement of new client workstation I've trouble for connection
of these new machines ot My different SQL Servers. On this configuration we
only speak of client/server connected on the same LAN without any antivirus
enabled.
When my users hae their new PC's (W2K - MDAC 2.6 SP1), they try to connect
to my server via for example ODBC and in this case when they browse network
they can't see named instance (only default instance is displayed (port 1433
)
!). Next to it if they force the name in the connection string they still
can't connect ot the server, because of the port resolution. My workaround
today is to force the port in the connection string of each client (quite
heavy, 2500 workstations !!!) On my servers I have TCP/IP and Named Pipes
enable.
I've performed different test of connection (telnet 1433 work, PortQRY
return that 1433 and 1434 are working (but it didn't return all the instance
s
name), ping OK, tracert ok,...)
Any help would be appreciated, thanks in advance
SylvainCan you please follow below links and let us know if it was helpful for you.
http://sqljunkies.com/How%20To/2E11...485DFA439B.scuk
&
http://support.microsoft.com/defaul...kb;en-us;287932
Regards
Surajit
"Sylvain" wrote:

> Hi all,
> Since the replacement of new client workstation I've trouble for connectio
n
> of these new machines ot My different SQL Servers. On this configuration w
e
> only speak of client/server connected on the same LAN without any antiviru
s
> enabled.
> When my users hae their new PC's (W2K - MDAC 2.6 SP1), they try to connect
> to my server via for example ODBC and in this case when they browse networ
k
> they can't see named instance (only default instance is displayed (port 14
33)
> !). Next to it if they force the name in the connection string they still
> can't connect ot the server, because of the port resolution. My workaround
> today is to force the port in the connection string of each client (quite
> heavy, 2500 workstations !!!) On my servers I have TCP/IP and Named Pipes
> enable.
> I've performed different test of connection (telnet 1433 work, PortQRY
> return that 1433 and 1434 are working (but it didn't return all the instan
ces
> name), ping OK, tracert ok,...)
> Any help would be appreciated, thanks in advance
> Sylvain|||Thanks for your reply.
Concerning the first link, after checking all cases the result is the same
than before, the only workaround is to create an alias (force port number).
All my clients even set on dynamically determine port, can't find an instanc
e
other than the default except if I set manually the expected port by the
server.
For the second link, after checking with my network team we have validate
that no firewall are placed between clients and servers.
Thanks for your help
Sylvain
"surajits" wrote:
[vbcol=seagreen]
> Can you please follow below links and let us know if it was helpful for yo
u.
> http://sqljunkies.com/How%20To/2E11...485DFA439B.scuk
> &
> http://support.microsoft.com/defaul...kb;en-us;287932
>
> Regards
> Surajit
>
>
> "Sylvain" wrote:
>

connection issue with enterprise manager but works with management studio

Hi,

I have an interesting scenario.

I have a SQL Server 2000 Standard Edition instance running on Computer A. I'm trying to access it through computers B and C.

Computer B has Sql Server 2005 Express Edition installed and I was able to use its Management Studio and
connect to instance on Computer A.

Computer C has SQL Server 2000 Standard Edition installed. When I try to connect to the instance on Computer A,
I get connection failed message.

I checked some settings. Both TCP/IP and Named pipes are enabled on the instance in A. The TCP/IP port is set to 1433 for
both client and server.

Please give me some ideas as to how I can solve this problem.

-Thanks

What is the error message that is displayed?|||I am assuming all three are on the same network then it is a simple right click at the top of Management Studio and register the 2000 then it becomes local to you. I have registered 68 7/2000 in one box so it works . Hope this helps.|||

The error said something like

Invalid Connection.ConnetionOpen(Invalid Instance)

|||

I figured it out.

Both A and C had Sql Server 2000 instances. When you try to connect to one Sql Server 2000 instance from another, Enterprise Manager automatically sets "Dynamically determine port" option and hence the connection fails. What you can do is use the Client Network Utility in C and create a new TCP/IP alias and uncheck the "dynamically determine port" option and manually set it to 1433. Then u can use Enterprise Manager in C and select the new alias that you created and finish registering the 2000 instance from A.

Thanks for your replies.

|||

shiversticks:

I figured it out.

Both A and C had Sql Server 2000 instances. When you try to connect to one Sql Server 2000 instance from another, Enterprise Manager automatically sets "Dynamically determine port" option and hence the connection fails. What you can do is use the Client Network Utility in C and create a new TCP/IP alias and uncheck the "dynamically determine port" option and manually set it to 1433. Then u can use Enterprise Manager in C and select the new alias that you created and finish registering the 2000 instance from A.

Thanks for your replies.

(on the same network then it is a simple right click at the top of Management Studio and register the 2000 then it becomes local to you. I have registered 68 7/2000 in one box so it works )

For the reference of future readers of this thread you just right click and register the other SQL Server as I originally posted and leave your port setings alone in eigth years I have not had reason to touch port settings it is not needed. Port settings could lead to SQL injection attacks.

Connection issue - Even Admin in the Server Machine

I am having administrative previlages in the SQL Server Machine, but I am
not able to connect to the SQL Server instance. Can you please help. I am
using windows authendication.
Thanks...SafeerI tried telnet ipaddress 1433, its not connecting thru the port.
I am connected to the server directly and then checked the port using server
utility and its 1433.
"Safeer" <safeerm@.gmail.com> wrote in message
news:e1jmNjrVHHA.4028@.TK2MSFTNGP04.phx.gbl...
> I am having administrative previlages in the SQL Server Machine, but I am
> not able to connect to the SQL Server instance. Can you please help. I am
> using windows authendication.
> Thanks...Safeer
>|||I tried telnet ipaddress 1433, its not connecting thru the port.
I am connected to the server directly and then checked the port using server
utility and its 1433.
"Safeer" <safeerm@.gmail.com> wrote in message
news:e1jmNjrVHHA.4028@.TK2MSFTNGP04.phx.gbl...
> I am having administrative previlages in the SQL Server Machine, but I am
> not able to connect to the SQL Server instance. Can you please help. I am
> using windows authendication.
> Thanks...Safeer
>|||We need more info.
- What version and edition of SQL Server are you using?
- What version of the Windows are you using?
It sounds like you are connecting from a client on another computer. If you
are using SQL Server 2005, use the Surface Area Configuration tool to
confirm that your SQL Server instance is listening for remote connections.
Also, a firewall could be blocking 1433. This is common with Windows XP
service pack 2.
If SQL Server is running on Vista, you have other issues.
For SQL Server 2005, there is a short tutorial that will help. See
http://msdn2.microsoft.com/en-us/library/ms345318.aspx
--
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Safeer" <safeerm@.gmail.com> wrote in message
news:eu1sb1rVHHA.1016@.TK2MSFTNGP04.phx.gbl...
>I tried telnet ipaddress 1433, its not connecting thru the port.
> I am connected to the server directly and then checked the port using
> server
> utility and its 1433.
>
> "Safeer" <safeerm@.gmail.com> wrote in message
> news:e1jmNjrVHHA.4028@.TK2MSFTNGP04.phx.gbl...
>|||Hi,
Windows: - Windows NT 5.2 (Build 3790: Service Pack 1)
SQL:- Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Standard Edition
My workstation is Windows 2000. I am connecting to the server using MSTSC.
My sql server log shows the following.
"SQL server listening on Shared Memory, Named Pipes."
Actually TCP/IP/1433 is enabled in the server.
& I am not able to telnet the machine with port 1433 from the server itself.
NB: No one is using this machine now and I need to setup and install service
packs. Its a new box with installed SQL 2K and nobody know the SA password.
Thanks...Safeer
"Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
news:08EB12C9-D906-4977-A40E-0F050C837E1E@.microsoft.com...
> We need more info.
> - What version and edition of SQL Server are you using?
> - What version of the Windows are you using?
> It sounds like you are connecting from a client on another computer. If
you
> are using SQL Server 2005, use the Surface Area Configuration tool to
> confirm that your SQL Server instance is listening for remote connections.
> Also, a firewall could be blocking 1433. This is common with Windows XP
> service pack 2.
> If SQL Server is running on Vista, you have other issues.
> For SQL Server 2005, there is a short tutorial that will help. See
> http://msdn2.microsoft.com/en-us/library/ms345318.aspx
> --
> Rick Byham (MSFT)
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Safeer" <safeerm@.gmail.com> wrote in message
> news:eu1sb1rVHHA.1016@.TK2MSFTNGP04.phx.gbl...
am[vbcol=seagreen]
am[vbcol=seagreen]
>|||It looks like your SQL Server is listening on shared memory (which is a
local pipe) and named pipes, but is not listening on TCP/IP. So if you want
to connect using TCP/IP and port 1433, you will have to enable TCP/IP and
restart SQL Server. You use the Server Network Utility for that.
--
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Safeer" <safeerm@.gmail.com> wrote in message
news:uCxeUt5VHHA.868@.TK2MSFTNGP05.phx.gbl...
> Hi,
> Windows: - Windows NT 5.2 (Build 3790: Service Pack 1)
> SQL:- Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Standard Edition
> My workstation is Windows 2000. I am connecting to the server using MSTSC.
> My sql server log shows the following.
> "SQL server listening on Shared Memory, Named Pipes."
> Actually TCP/IP/1433 is enabled in the server.
> & I am not able to telnet the machine with port 1433 from the server
> itself.
> NB: No one is using this machine now and I need to setup and install
> service
> packs. Its a new box with installed SQL 2K and nobody know the SA
> password.
> Thanks...Safeer
>
> "Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
> news:08EB12C9-D906-4977-A40E-0F050C837E1E@.microsoft.com...
> you
> rights.
> am
> am
>|||Hi Rick,
I've already did that. Now I did it again and restarted the server. In the
Server Netwrok Utility, its showing tcp/ip. But the log is not showing
TCP/IP.
Thanks...Safeer
"Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
news:53642094-FE1C-4BFB-85BF-E114587DDB0F@.microsoft.com...
> It looks like your SQL Server is listening on shared memory (which is a
> local pipe) and named pipes, but is not listening on TCP/IP. So if you
want
> to connect using TCP/IP and port 1433, you will have to enable TCP/IP and
> restart SQL Server. You use the Server Network Utility for that.
> --
> Rick Byham (MSFT)
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Safeer" <safeerm@.gmail.com> wrote in message
> news:uCxeUt5VHHA.868@.TK2MSFTNGP05.phx.gbl...
Edition[vbcol=seagreen]
MSTSC.[vbcol=seagreen]
message[vbcol=seagreen]
I[vbcol=seagreen]
I[vbcol=seagreen]
>|||Is the SQL Server Browser service started?
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"Safeer" <safeerm@.gmail.com> wrote in message
news:e%23n1O5eWHHA.4668@.TK2MSFTNGP04.phx.gbl...
> Hi Rick,
> I've already did that. Now I did it again and restarted the server. In the
> Server Netwrok Utility, its showing tcp/ip. But the log is not showing
> TCP/IP.
> Thanks...Safeer
>
> "Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
> news:53642094-FE1C-4BFB-85BF-E114587DDB0F@.microsoft.com...
> want
> rights.
> Edition
> MSTSC.
> message
> I
> I
>|||Its SQL Server 2000.
"William (Bill) Vaughn" <billvaRemoveThis@.nwlink.com> wrote in message
news:uPPE4YgWHHA.4384@.TK2MSFTNGP02.phx.gbl...
> Is the SQL Server Browser service started?
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> ----
---
> "Safeer" <safeerm@.gmail.com> wrote in message
> news:e%23n1O5eWHHA.4668@.TK2MSFTNGP04.phx.gbl...
the[vbcol=seagreen]
message[vbcol=seagreen]
and[vbcol=seagreen]
to[vbcol=seagreen]
>|||Okay, did you follow the checklist shown in:
http://betav.com/blog/billva/2006/0..._connected.html ?
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"Safeer" <safeerm@.gmail.com> wrote in message
news:eR6kqFsWHHA.3332@.TK2MSFTNGP04.phx.gbl...
> Its SQL Server 2000.
>
> "William (Bill) Vaughn" <billvaRemoveThis@.nwlink.com> wrote in message
> news:uPPE4YgWHHA.4384@.TK2MSFTNGP02.phx.gbl...
> rights.
> ---
> the
> message
> and
> to
>

Connection issue - Even Admin in the Server Machine

I am having administrative previlages in the SQL Server Machine, but I am
not able to connect to the SQL Server instance. Can you please help. I am
using windows authendication.
Thanks...Safeer
I tried telnet ipaddress 1433, its not connecting thru the port.
I am connected to the server directly and then checked the port using server
utility and its 1433.
"Safeer" <safeerm@.gmail.com> wrote in message
news:e1jmNjrVHHA.4028@.TK2MSFTNGP04.phx.gbl...
> I am having administrative previlages in the SQL Server Machine, but I am
> not able to connect to the SQL Server instance. Can you please help. I am
> using windows authendication.
> Thanks...Safeer
>
|||I tried telnet ipaddress 1433, its not connecting thru the port.
I am connected to the server directly and then checked the port using server
utility and its 1433.
"Safeer" <safeerm@.gmail.com> wrote in message
news:e1jmNjrVHHA.4028@.TK2MSFTNGP04.phx.gbl...
> I am having administrative previlages in the SQL Server Machine, but I am
> not able to connect to the SQL Server instance. Can you please help. I am
> using windows authendication.
> Thanks...Safeer
>
|||We need more info.
- What version and edition of SQL Server are you using?
- What version of the Windows are you using?
It sounds like you are connecting from a client on another computer. If you
are using SQL Server 2005, use the Surface Area Configuration tool to
confirm that your SQL Server instance is listening for remote connections.
Also, a firewall could be blocking 1433. This is common with Windows XP
service pack 2.
If SQL Server is running on Vista, you have other issues.
For SQL Server 2005, there is a short tutorial that will help. See
http://msdn2.microsoft.com/en-us/library/ms345318.aspx
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Safeer" <safeerm@.gmail.com> wrote in message
news:eu1sb1rVHHA.1016@.TK2MSFTNGP04.phx.gbl...
>I tried telnet ipaddress 1433, its not connecting thru the port.
> I am connected to the server directly and then checked the port using
> server
> utility and its 1433.
>
> "Safeer" <safeerm@.gmail.com> wrote in message
> news:e1jmNjrVHHA.4028@.TK2MSFTNGP04.phx.gbl...
>
|||Hi,
Windows: - Windows NT 5.2 (Build 3790: Service Pack 1)
SQL:- Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Standard Edition
My workstation is Windows 2000. I am connecting to the server using MSTSC.
My sql server log shows the following.
"SQL server listening on Shared Memory, Named Pipes."
Actually TCP/IP/1433 is enabled in the server.
& I am not able to telnet the machine with port 1433 from the server itself.
NB: No one is using this machine now and I need to setup and install service
packs. Its a new box with installed SQL 2K and nobody know the SA password.
Thanks...Safeer
"Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
news:08EB12C9-D906-4977-A40E-0F050C837E1E@.microsoft.com...
> We need more info.
> - What version and edition of SQL Server are you using?
> - What version of the Windows are you using?
> It sounds like you are connecting from a client on another computer. If
you
> are using SQL Server 2005, use the Surface Area Configuration tool to
> confirm that your SQL Server instance is listening for remote connections.
> Also, a firewall could be blocking 1433. This is common with Windows XP
> service pack 2.
> If SQL Server is running on Vista, you have other issues.
> For SQL Server 2005, there is a short tutorial that will help. See
> http://msdn2.microsoft.com/en-us/library/ms345318.aspx
> --
> Rick Byham (MSFT)
> This posting is provided "AS IS" with no warranties, and confers no
rights.[vbcol=seagreen]
> "Safeer" <safeerm@.gmail.com> wrote in message
> news:eu1sb1rVHHA.1016@.TK2MSFTNGP04.phx.gbl...
am[vbcol=seagreen]
am
>
|||It looks like your SQL Server is listening on shared memory (which is a
local pipe) and named pipes, but is not listening on TCP/IP. So if you want
to connect using TCP/IP and port 1433, you will have to enable TCP/IP and
restart SQL Server. You use the Server Network Utility for that.
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Safeer" <safeerm@.gmail.com> wrote in message
news:uCxeUt5VHHA.868@.TK2MSFTNGP05.phx.gbl...
> Hi,
> Windows: - Windows NT 5.2 (Build 3790: Service Pack 1)
> SQL:- Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Standard Edition
> My workstation is Windows 2000. I am connecting to the server using MSTSC.
> My sql server log shows the following.
> "SQL server listening on Shared Memory, Named Pipes."
> Actually TCP/IP/1433 is enabled in the server.
> & I am not able to telnet the machine with port 1433 from the server
> itself.
> NB: No one is using this machine now and I need to setup and install
> service
> packs. Its a new box with installed SQL 2K and nobody know the SA
> password.
> Thanks...Safeer
>
> "Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
> news:08EB12C9-D906-4977-A40E-0F050C837E1E@.microsoft.com...
> you
> rights.
> am
> am
>
|||Hi Rick,
I've already did that. Now I did it again and restarted the server. In the
Server Netwrok Utility, its showing tcp/ip. But the log is not showing
TCP/IP.
Thanks...Safeer
"Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
news:53642094-FE1C-4BFB-85BF-E114587DDB0F@.microsoft.com...
> It looks like your SQL Server is listening on shared memory (which is a
> local pipe) and named pipes, but is not listening on TCP/IP. So if you
want
> to connect using TCP/IP and port 1433, you will have to enable TCP/IP and
> restart SQL Server. You use the Server Network Utility for that.
> --
> Rick Byham (MSFT)
> This posting is provided "AS IS" with no warranties, and confers no
rights.[vbcol=seagreen]
> "Safeer" <safeerm@.gmail.com> wrote in message
> news:uCxeUt5VHHA.868@.TK2MSFTNGP05.phx.gbl...
Edition[vbcol=seagreen]
MSTSC.[vbcol=seagreen]
message[vbcol=seagreen]
I[vbcol=seagreen]
I
>
|||Is the SQL Server Browser service started?
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"Safeer" <safeerm@.gmail.com> wrote in message
news:e%23n1O5eWHHA.4668@.TK2MSFTNGP04.phx.gbl...
> Hi Rick,
> I've already did that. Now I did it again and restarted the server. In the
> Server Netwrok Utility, its showing tcp/ip. But the log is not showing
> TCP/IP.
> Thanks...Safeer
>
> "Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
> news:53642094-FE1C-4BFB-85BF-E114587DDB0F@.microsoft.com...
> want
> rights.
> Edition
> MSTSC.
> message
> I
> I
>
|||Its SQL Server 2000.
"William (Bill) Vaughn" <billvaRemoveThis@.nwlink.com> wrote in message
news:uPPE4YgWHHA.4384@.TK2MSFTNGP02.phx.gbl...
> Is the SQL Server Browser service started?
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> ----
---[vbcol=seagreen]
> "Safeer" <safeerm@.gmail.com> wrote in message
> news:e%23n1O5eWHHA.4668@.TK2MSFTNGP04.phx.gbl...
the[vbcol=seagreen]
message[vbcol=seagreen]
and[vbcol=seagreen]
to
>
|||Okay, did you follow the checklist shown in:
http://betav.com/blog/billva/2006/06/getting_and_staying_connected.html ?
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"Safeer" <safeerm@.gmail.com> wrote in message
news:eR6kqFsWHHA.3332@.TK2MSFTNGP04.phx.gbl...
> Its SQL Server 2000.
>
> "William (Bill) Vaughn" <billvaRemoveThis@.nwlink.com> wrote in message
> news:uPPE4YgWHHA.4384@.TK2MSFTNGP02.phx.gbl...
> rights.
> the
> message
> and
> to
>

Sunday, March 11, 2012

Connection handshake failed: Unexpected or badly formatted message.

Hello,

I am unable to send a message to a target service on a different SQL Server instance. Using the SQL Profiler, I get the following error from the target machine:

Broker::Connection: Connection handshake failed: An OS call failed: (80090326) 0x80090326(The message received was unexpected or badly formatted.). State 106.

On the initiator side, the transmission_status shows the following error:

An error occurred while receiving data: '64(The specified network name is no longer available.)'.

Any ideas on why the target thinks the message is "unexpected or badly formatted"? Btw, I am specifying the default message type and contract for the services.

Thanks.

The problem is in the NTLM/Kerberos authentification sequence and I reckon I never saw it before. If you only want to get this to work, you can change the endpoint authentication from WINDOWS to CERTIFICATE. If you want to see why is this failing in the first place, I suggest you follow up using the MS Connect site at https://connect.microsoft.com/SQLServer/Feedback?wa=wsignin1.0. A netmon capture of the handhsake sequence would be needed to investigate this.

connection from virtual ip address to firewall?

Hi,
We try to connect from a same named instance to a linked sql server in the
DMZ. The firewall has been set up to allow connections from the virtual ip
address of the instance to pass through and the linked server has been set
up correctly to connect through TCP/IP and the correct port. However, we
cannot connect and we see on the firewall that the requests are coming from
the active cluster node, not from the virtual ip address (even if we open a
Remote Desktop connection to the virtual server name). How can we solve
this?
Hans
This is how clustering works. Make sure you have the Node's IP defined for
access through the firewall.
Cheers,
Rod
"HVE" <eylenh@.hotmail.com> wrote in message
news:1e3yhnhwapvac.q9iklq79zipt$.dlg@.40tude.net...
> Hi,
> We try to connect from a same named instance to a linked sql server in the
> DMZ. The firewall has been set up to allow connections from the virtual ip
> address of the instance to pass through and the linked server has been set
> up correctly to connect through TCP/IP and the correct port. However, we
> cannot connect and we see on the firewall that the requests are coming
from
> the active cluster node, not from the virtual ip address (even if we open
a
> Remote Desktop connection to the virtual server name). How can we solve
> this?
> Hans

Thursday, March 8, 2012

Connection Failure to SQL Server 2005

I am trying to connect to a SQL Server 2005 instance from another machine
using Query Analyzer (SQL Server 2000 version) and I am getting the following
error:
Server: Msg 11, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error.
I can connect to other SQL Server 2000 versions but not the 2005.
Thanks
Allen
Did you enable the Allow Remote Connections option for the SQL2005 server
instance?
Andrew J. Kelly SQL MVP
"Allen" <Allen@.discussions.microsoft.com> wrote in message
news:7F4792F3-8931-4E92-BEDA-0058D9917CFD@.microsoft.com...
>I am trying to connect to a SQL Server 2005 instance from another machine
> using Query Analyzer (SQL Server 2000 version) and I am getting the
> following
> error:
> Server: Msg 11, Level 16, State 1
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error.
> I can connect to other SQL Server 2000 versions but not the 2005.
> Thanks
> --
> Allen

Connection Failure to SQL Server 2005

I am trying to connect to a SQL Server 2005 instance from another machine
using Query Analyzer (SQL Server 2000 version) and I am getting the followin
g
error:
Server: Msg 11, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][DBNETLIB]General network err
or.
I can connect to other SQL Server 2000 versions but not the 2005.
Thanks
--
AllenDid you enable the Allow Remote Connections option for the SQL2005 server
instance?
Andrew J. Kelly SQL MVP
"Allen" <Allen@.discussions.microsoft.com> wrote in message
news:7F4792F3-8931-4E92-BEDA-0058D9917CFD@.microsoft.com...
>I am trying to connect to a SQL Server 2005 instance from another machine
> using Query Analyzer (SQL Server 2000 version) and I am getting the
> following
> error:
> Server: Msg 11, Level 16, State 1
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network e
rror.
> I can connect to other SQL Server 2000 versions but not the 2005.
> Thanks
> --
> Allen|||I've serched high and low for this facility and cannot find it.
I have enabled both client/server tcp/ip named pipes shared memory
and still cannot connect.
"Andrew J. Kelly" wrote:

> Did you enable the Allow Remote Connections option for the SQL2005 server
> instance?
> --
> Andrew J. Kelly SQL MVP
>
> "Allen" <Allen@.discussions.microsoft.com> wrote in message
> news:7F4792F3-8931-4E92-BEDA-0058D9917CFD@.microsoft.com...
>
>|||how does one:
enable the Allow Remote Connections option for the SQL2005 server
> instance?
I've set up ports and enabled tcp/ip, shared memory, pipes and do not see a
Allow Remote Connections option
I've shut off my firewall. I just installed sql server 2005 and am trying to
connect on the SAME MACHINE
"Landon Kelsey" wrote:
[vbcol=seagreen]
> I've serched high and low for this facility and cannot find it.
> I have enabled both client/server tcp/ip named pipes shared memory
> and still cannot connect.
> "Andrew J. Kelly" wrote:
>|||Try running through this quick tutorial to see if you missed anything:
http://msdn2.microsoft.com/en-us/library/ms345318(en-US,SQL.90).aspx
--
Rick Byham
MCDBA, MCSE, MCSA
Documentation Manager,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.
"Landon Kelsey" <landonmkelsey@.hotmail.com> wrote in message
news:D98FEEC7-327F-4079-A971-B8A30A6D8FAE@.microsoft.com...[vbcol=seagreen]
> how does one:
> enable the Allow Remote Connections option for the SQL2005 server
> I've set up ports and enabled tcp/ip, shared memory, pipes and do not see
> a
> Allow Remote Connections option
> I've shut off my firewall. I just installed sql server 2005 and am trying
> to
> connect on the SAME MACHINE
>
> "Landon Kelsey" wrote:
>

Wednesday, March 7, 2012

Connection error to remote SQL instance, over VPN

I am trying to connect to an instance of SQL Express through a vpn, simply using the SQL Management Studio, providing the server ip address x.x.x.x\MSSQLSERVER, and using SQL authentication login. I receive the following message:

Cannot connect to <server>, etc., etc.

error 25: - Connection string is not valid

Does anyone understand this? I am trying to connect through the SQL Server Management interface, not with a client program that would utilize a connection string. Is there something which prevents Management Studio from working over a vpn?

To connect, I am using SQL authentication, and have verified the login and password locally on the target pc. The SQL browser service is running on the target pc, and I can telnet to the port which it is monitoring, through the same vpn connection. Remote connections are enabled for TCP/IP in the Surface Area configuration on the target pc.

Any help appreciated.

x.x.x.x\MSSQLSERVER is not correct. You cannot use MSSQLSERVER as the instance name because it is reserved for default instance. Since your instance is SSE, you should use x.x.x.x\sqlexpress. Based on your description, your connection should work with the fix. Please make sure UDP port 1434 (used by sql browser) is blocked by firewall.|||

SSE is installed as the default instance, so /MSSQLSERVER does work, as tested locally. Also the assigned port is opened through the firewall, as tested by telnetting through the vpn.

However here is additional information since I posted the problem: Using a packet tracker, I can see no handshaking messages are transmitted on the vpn network when the connection is attempted by SSE Studio. If I connect to a local SQL pc (on my local, non-virtual network), I see the TCP messages, handshaking, etc. and it instantly connects. Why does SSE Studio not attempt to connect over the vpn network? Ping and telnet do work over that network, so the operating system correctly distinguishes the networks. Just not SSE Studio. Is there a way to force it to this network?

|||If it's default instance, you should remove MSSQLSERVER, use x.x.x.x only. Also, use c:\windows\system32\cliconfg.exe on your client machine to check whether TCP is enabled on the client. Is your server listening on TCP port 1433? If not, please confirm sql browser is running and UDP port 1434 is in firewall's exception list. Thanks.|||

I figured it out, the connection text must specify the port after the ip address. Format:

x.x.x.x,1433 (or whatever port #)

It works in SSE Studio, and in the client app. (Access project). An example is here: http://www.connectionstrings.com/, under SQL Server connections -> SqlConnection(.NET) -> connection via ip address.

What is confusing is that the port specification is apparently not required if connecting to another pc on the same lan, only if connecting over the internet/vpn.

|||

If x.x.x.x,1433 workes, x.x.x.x should work unless your have any alias defined for x.x.x.x. You use c:\windows\system32\cliconfg.exe to check it.

If you tcp port is not 1433, then you must make sure sql browser is running and UDP port 1434 is not blocked. "x.x.x.x,port" can bypass the requirement of sql browser.

Saturday, February 25, 2012

Connection Error from ASP.Net under IIS: provider: Named Pipes Provider, error: 40

We experience the 40 error when our Asp.net code runs under IIS and uses named pipes to a sql server 2005 named instance.

We've tried all suggestions found on blogs and KB articles such as making sure the named pipes protocol is enabled, making sure the Browser service is started, making sure Allow Remote Connections is enabled, making sure we're not using Asp.Net 2.0 membership providers, and the list goes on and on.

We boiled it down to a simple test scenario. We open a SqlConnection to the sql 2005 box in the code with the intention of binding a datareader to a gridview, but it never gets that far because the connection.Open() fails.

If we run this test application as a virtual directory in IIS and Asp.Net 2.0, the connection.Open() fails.

If we run this test application from Visual Studio .Net using Cassini (PWS), the connection.Open() succeeds and binds to the gridview.

What could be causing the connection to fail under IIS but succeed under Cassini? We've tried setting IIS to run as a domain user and with digest authentication enabled. That made no difference.

Any help or insight is appreciated!

Could you try to answer the following questions though some of them may be already implied by your post?

(1) Is this remote connection or local connection?

(2) Is the account that runing your visual studio.net the the same as your IIS. Do you impersonate client connection in IIS?

(3) Can you make direct connection to your backend sqlserver from your virtual studio or sql server management studio?

(4) Can you try connecting using TCP instead? If not, what is the error code?

|||

(1) Is this remote connection or local connection?

-Remote connection

(2) Is the account that runing your visual studio.net the the same as your IIS. Do you impersonate client connection in IIS?

-Same account, windows authentication. No impersonation

(3) Can you make direct connection to your backend sqlserver from your virtual studio or sql server management studio?

-Management Studio works, Cassini works.. IIS does not

(4) Can you try connecting using TCP instead? If not, what is the error code?

TCP gives "server actively refused connection" error

|||

Does your connection string like "servername\instancename" or something else?

The TCP failure indicates either the server TCP listener is not up or client uses different TCP port to connect. So please check whether the TCP is enabled or not. Restart the server after the configuration change. Then check if the connection string has instancename specified. Once you find out which port the server is listening on, you can also use "tcpTongue Tiedervername,port" to connection to the server.

Connection error

Hi there,

I installed Visual Web Developer Express and SQL Server Express. I then installed the Time Tracker Starter Kit on my localhost. My instance of SQL Server Express is 'Express'. So I updated the root web.config file. I try out the app. by creating a new user and then get this error:

Exception Details:System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I'm using a HTTP connection port 7080 (ie,http://localhost:7080/TimeTracker/), does that mean I have to update anything in the app?

I was told to update SQL Server 2005 Surface Area Configuration - Remote Connections to Using both TCP/IP and named pipes. So I already did that and rebooted.

Any suggestions?

Post your connection string, it may helpSmile|||

Hey it works.

I noticed that I had to modify the database connnection under the database explorer, even though I had updated the web.config

Take care

Connection error

Hi All
when i try to register an instance of SQL server sometimes it's registered
successfully and sometimes not, giving me the error SQL server Error:17 SQL
server does not exist or access denied.
I installed service pack 3 and i still get error.
Also when i try to add a Data source, i can do it successfully using named
pipes as the network protocol but it fails with TCP/IP.
Thanks for your helpWhat is the OS Error printed when the connection fails from a Test ODBC DSN?
Example: 11001 , 10060 These are sockets errors.
Post the Exact error message and/or search on the errors in the kb article.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Friday, February 24, 2012

Connection error

Hi All
when i try to register an instance of SQL server sometimes it's registered
successfully and sometimes not, giving me the error SQL server Error:17 SQL
server does not exist or access denied.
I installed service pack 3 and i still get error.
Also when i try to add a Data source, i can do it successfully using named
pipes as the network protocol but it fails with TCP/IP.
Thanks for your helpprobably is ur network having probs. check if u can telenet to port 1433. if u can't, check ur network settings, if u still can't telenet, try restart ur syste
-- Nader Galal wrote: --
Hi Al
when i try to register an instance of SQL server sometimes it's registere
successfully and sometimes not, giving me the error SQL server Error:17 SQ
server does not exist or access denied
I installed service pack 3 and i still get error
Also when i try to add a Data source, i can do it successfully using name
pipes as the network protocol but it fails with TCP/IP
Thanks for your hel|||You must have appropriate information to connect to the server, (name or IP,
and port number)...
The server must be listening on the same network protocol that the client is
trying to connect with ( server network utility, and client network
utility).
Lastly you must register the server with a login that is a valid SQL server
login for the server.
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Nader Galal" <ngalal@.hotmail.com> wrote in message
news:uKag%23agyDHA.2720@.TK2MSFTNGP09.phx.gbl...
> Hi All
> when i try to register an instance of SQL server sometimes it's registered
> successfully and sometimes not, giving me the error SQL server Error:17
SQL
> server does not exist or access denied.
> I installed service pack 3 and i still get error.
> Also when i try to add a Data source, i can do it successfully using named
> pipes as the network protocol but it fails with TCP/IP.
> Thanks for your help
>
>