473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Very strange behavior of SQLServer with connection from CGI

Hello,
I developed a win32 .exe CGI that connects to a clustered SQLServer to
report some data.
The software is written with Borland C++Builder.
This is the oledb string:
Name=Provider=SQLOLEDB;Password=xxx;Persist Security Info=True;User
ID=xxxx;Data Source=xxxxx;Initial Catalog=xxxxx;Network
Library=dbmssocn

It suddendly stopped working on my customer network, so I made some
test and I verivied that the problem is on the connection with
SQLServer: my test program just opens a connection, closes it and
exits, reporting in a log file if the open was successful or failed.

If I run the program locally, just launching it, no problem, it works.
I can run it mutilple time continuosly and is connects every time.

If I run the program through my webserver, as a CGI that's how it is
supposed to work (http:\\localhost\scripts\connect.exe), it connects
the first time, and then I have to wait 40 seconds to connect again
successfully, or it fails.

If I try against MY sqlserver on my laptop or on my network no 40 sec
problems, but on my customer network, with THEIR SQLServer , if I try
to connect from their webserver, or from my laptop webserver, I have
this 40sec problem.

I analyzed the network traffic, and I discovered that when I run my
test program locally it originates only TCP/IP packets, and SQLServer
answers only with TCP/IP.
But when I use it from the webserver as a CGI, it originates an UDP
packet, then SQL answers with another UDP packet, and then they
communicate over TCP/IP.
This when it works: the second time my program continues to send the
UDP packet, but it receives no answer, and fails the communication.

I can only say that:
- we haven't touched the program for months, and it really stopped
working suddendly, so I suspect that something in my customer netowrk
has changed
- I tried many different OLEDB strings, disabling connection pooling
and all the services, calling the SQLServer by name or IP...
- the problem can't be related to my program, because now is really
just an oledb connection test

Anyone have an idea?

Thank you very much,
Mattia
Jul 23 '05 #1
1 2026
First guess, this is not a default SQL instance. I think your customer
network has disabled UDP as a "security" measure. SQL clients use a UDP
connection to port 1434 to resolve port numbers for named instances. If
your customer won't allow UPD, you can modify the connection information to
include the port number of the named instance or create a client alias that
specifies a port number. You can use the SQL Server Network utility to lock
an instance to a port number.

Finally, don't cross-post to the universe.

--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com

I support the Professional Association for SQL Server
www.sqlpass.org

<md**************@hotmail.com> wrote in message
news:ju********************************@4ax.com...
Hello,
I developed a win32 .exe CGI that connects to a clustered SQLServer to
report some data.
The software is written with Borland C++Builder.
This is the oledb string:
Name=Provider=SQLOLEDB;Password=xxx;Persist Security Info=True;User
ID=xxxx;Data Source=xxxxx;Initial Catalog=xxxxx;Network
Library=dbmssocn

It suddendly stopped working on my customer network, so I made some
test and I verivied that the problem is on the connection with
SQLServer: my test program just opens a connection, closes it and
exits, reporting in a log file if the open was successful or failed.

If I run the program locally, just launching it, no problem, it works.
I can run it mutilple time continuosly and is connects every time.

If I run the program through my webserver, as a CGI that's how it is
supposed to work (http:\\localhost\scripts\connect.exe), it connects
the first time, and then I have to wait 40 seconds to connect again
successfully, or it fails.

If I try against MY sqlserver on my laptop or on my network no 40 sec
problems, but on my customer network, with THEIR SQLServer , if I try
to connect from their webserver, or from my laptop webserver, I have
this 40sec problem.

I analyzed the network traffic, and I discovered that when I run my
test program locally it originates only TCP/IP packets, and SQLServer
answers only with TCP/IP.
But when I use it from the webserver as a CGI, it originates an UDP
packet, then SQL answers with another UDP packet, and then they
communicate over TCP/IP.
This when it works: the second time my program continues to send the
UDP packet, but it receives no answer, and fails the communication.

I can only say that:
- we haven't touched the program for months, and it really stopped
working suddendly, so I suspect that something in my customer netowrk
has changed
- I tried many different OLEDB strings, disabling connection pooling
and all the services, calling the SQLServer by name or IP...
- the problem can't be related to my program, because now is really
just an oledb connection test

Anyone have an idea?

Thank you very much,
Mattia

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: FC | last post by:
Hello all: I have a very basic question about oracle database structures. I am coming from MS SQLServer where I have three "databases", each database has three "tables". I can access any table...
6
by: leonecla | last post by:
Hi everybody, I'm facing a very very strange problem with a very very simple C program... My goal should be to write to a binary file some numbers (integers), each one represented as a sequence...
0
by: ivb | last post by:
Hi all, I am using DB2 8.1.11.1 on NT with ASP.NET 1.1 When application make connection to database (via ADO.NET), it set "Connection timeout" parameter to 30 seconds. After, when my webpage...
2
by: Antonio | last post by:
Good morning, everyone. Here is the strange behavior: I have a datagrid (dgPIs) with paging enabled. When I click to view any page in the grid, it runs the private void lnkIPReg method,...
12
by: John | last post by:
I can't get my head around this! I have the following code: <% .... Code for connection to the database ... .... Code for retrieving recordset ... If Not rs.EOF Then ... Do something...
10
by: John Kraft | last post by:
Hello all, I'm experiencing some, imo, strange behavior with the StreamReader object I am using in the code below. Summary is that I am downloading a file from a website and saving it to disk...
9
by: dan | last post by:
within a loop i am building a sql insert statement to run against my (programatically created) mdb. it works but it seems unreasonably SLOW! Sorry, dont have the code here but the jist is very...
2
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
How to configure the IIS, ASPNET userID, Windows or SQL Authentiation, std or integrated security for SQLserver database? The VS.net 2002 web server and SQL Server client are at the same PC, ...
6
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
Yesterday Visual Studio gave me a strange error both at compiletime and at designtime that had no obvious connection to anything I had changed recently. After some effort tracking down the problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.