I have the following page -
<html xmlns="http://www.w3.org/1999/xhtml">
-
-
<head>
-
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
-
<title>Time Data</title>
-
</head>
-
-
<body>
-
<%
-
-
Set oConn = Server.CreateObject("ADODB.Connection")
-
oConn.ConnectionTimeout = 120
-
oConn.Open "Provider=SQLOLEDB; Server=xxxxx; Database=MDR; Uid=xxxxx; Pwd=xxxxx"
-
-
Dim rs
-
Set rs = Server.CreateObject("ADODB.Recordset")
-
SQL = "SELECT TOP 1 AVG(Zero) FROM mCallEnd WHERE (CallKind=0 OR CallKind=1 OR CallKind=16) AND Zero>0 AND OrgAccount=5127066669 AND Timestamp >= DATEDIFF(n, '12-31-1899', DATEADD(dd, DATEDIFF(dd,0,getdate()), 0))"
-
Set rs = oConn.execute(SQL)
-
-
-
do while NOT rs.EOF
-
if rs.recordcount = 0 then
-
Response.Write "No records returned"
-
else
-
-
Dim Zero_Sec
-
Zero_Sec = rs("Zero")
-
-
Response.Write "Average “Zero” field since midnight: " & Zero_Sec %><br /> <%
-
rs.MoveNext
-
end if
-
-
Loop
-
rs.Close
-
Set rs = Nothing
-
oConn.Close
-
Set oConn = Nothing
-
-
-
Set oConn2 = Server.CreateObject("ADODB.Connection")
-
-
oConn2.Open "Provider=SQLOLEDB; Server=xxxxxx; Database=MDR; Uid=xxxxx Pwd=xxxxx3"
-
-
Dim rs2
-
Set rs2 = Server.CreateObject("ADODB.Recordset")
-
SQL2 = "SELECT TOP 1 Zero FROM mCallEnd WHERE (CallKind=0 OR CallKind=1 OR CallKind=16) AND OrgAccount=5127066669 ORDER BY Timestamp DESC"
-
Set rs2 = oConn2.execute(SQL2)
-
-
-
do while NOT rs2.EOF
-
if rs2.recordcount = 0 then
-
Response.Write "No records returned"
-
else
-
-
Zero = rs2("Zero")
-
-
Response.Write "The actual Zero amount for the last account entry is: " & Zero %><br /> <%
-
rs2.MoveNext
-
end if
-
-
Loop
-
rs2.Close
-
Set rs2 = Nothing
-
oConn2.Close
-
Set oConn2 = Nothing
-
%>
-
and when I try to go to it, I receive the error 80040e31, I've reviewed several web pages pertaining to this and they all seem to talk about the connection string as being something that can cause this issue. Can someone please take a look at my connection string and see if this is what may be causing my issue with this page?
Thank you,
Doug
10 5503
It could be a million things, including an invalid username and password, your sql server not allowing the connection, the user does not have the rights to the db, etc...
~~ CK
CK,
this page: -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
-
<head>
-
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
-
<title>Time Data</title>
-
</head>
-
-
<body>
-
<%
-
-
-
-
Set oConn2 = Server.CreateObject("ADODB.Connection")
-
-
oConn2.Open "Provider=SQLOLEDB; Server=10.2.1.41; Database=MDR; Uid=xxxxx; Pwd=xxxxxx"
-
-
Dim rs2
-
Set rs2 = Server.CreateObject("ADODB.Recordset")
-
SQL2 = "SELECT TOP 1 Zero FROM mCallEnd WHERE (CallKind=0 OR CallKind=1 OR CallKind=16) AND OrgAccount=5127066669 ORDER BY Timestamp DESC"
-
Set rs2 = oConn2.execute(SQL2)
-
-
-
do while NOT rs2.EOF
-
if rs2.recordcount = 0 then
-
Response.Write "No records returned"
-
else
-
-
Zero = rs2("Zero")
-
-
Response.Write "The actual Zero amount for the last account entry is: " & Zero %><br /> <%
-
rs2.MoveNext
-
end if
-
-
Loop
-
rs2.Close
-
Set rs2 = Nothing
-
oConn2.Close
-
Set oConn2 = Nothing
-
%>
-
-
-
-
-
</body>
-
</html>
-
produces a result on the same server, so I know it's not a permission issue but something wrong with the first query. Does that help in narrowing down a bit?
Thank you
Doug
Get query from your first post and put it in your second post and run it. If it fails, your query is your problem, not the connection.
Good Luck!!!
~~ CK
CK,
I ran the query on the server itself and it took almost 2:45. I increased the time out in the page itself to 3600 seconds and still had the same issue. I know it's not the query because that works.
Get the connection string on your second post and use it on your first post and see if it will work...
Good Luck!!!
~~ CK
I just tried the connection string from the second post and tried it ... still gave me a timeout.
here is the string that I tried:
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=SQLOLEDB; Server=10.2.1.41; Database=MDR; Uid=xxxxx; Pwd=xxxxx
here is what it was:
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionTimeout = 120
oConn.Open "Provider=SQLOLEDB; Server=10.2.1.41; Database=MDR; Uid=xxxxx; Pwd=xxxxx"
Then it's not your connection string.
Is 120 in minutes or seconds? If it's in seconds, that's just 2 minutes...You said your query runs for more than that... You might want to increase it some more...
Good Luck!!!
~~ CK
CK,
I posted this on entry #5:
I increased the time out in the page itself to 3600 seconds and still had the same issue. I know it's not the query because that works.
I believe that it's the query that's causing the issue here, but I have no way of decreasing the amount of time that it's taking to make the calculations that it's doing.
Then let's optimize your query.
1. Do you have the proper index?
2. What's this: DATEDIFF(n, '12-31-1899', DATEADD(dd, DATEDIFF(dd,0,getdate()), 0)) for? As much as possible, avoid using function in your WHERE clause.
3. AVG is an aggregate function, no need to use TOP clause. It will always return a single record. Specially without the GROUP BY clause.
~~ CK
Hello,
80040e31 is for the timeout during the execution of the command not for the connection.
I am always using .Net Frameworks 3.5 or 4.0 with VB or VC#. I know that there is a commandtimeout. Maybe i am going wrong but it seems to me you are working with VB 6 and the "old" ADO . You should look in your documentation about a possible command timeout
Have a nice day
PostScriptum : Could you check whether there is a command timeout on the level of the server ( something like RemoteQueryTimeOut often set to 600 seconds ).
The DBA may have enabled the queries governor which limits the duration od a query.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: |
last post by:
I am accessing the same error-containing ASP page on an ISP server using w2k
IE6 but with different effect.
On the first computer I get several line of HTML outputed by ASP, shown
correctly by...
|
by: Patrick Masson |
last post by:
Hello,
Our configuration :
Apache 2.0.53
PHP 5.0.4
PC Windows 2000
MATLAB 6.1
We work on a consulting project in France which involves MATLAB Web server,
|
by: Javier Cortés Cortés |
last post by:
i am getting this error when i am trying to access
any file(with the ext. aspx) from my remote server.
the error is :
Server Error in '/' Application....
|
by: Darren |
last post by:
Hi,
I get the above error message when I try to run my page on the remote
server.
As I am a newbie with .net, I chose Project | Copy to copy the files needed
to a seperate local directory then...
|
by: Rod |
last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some
reason, opening some ASP.NET applications we wrote is producing the
following error message:
"The Web server reported...
|
by: Kevin Farless |
last post by:
Hi all,
I'm having trouble viewing any .aspx pages on my hosting company's server.
The server is a new box running Windows Server 2003 default installation.
I'm the first client to try using...
|
by: Lara |
last post by:
Hi,
I am getting the following error.
All the files are stored in a directory named 'web' as told by the Server
Administrtor
can anyone help me
Server Error in '/' Application....
|
by: David Lozzi |
last post by:
Howdy,
I found a nice little book called ASP.NET 2.0 Cookbook by Michael A Kittel
and Geoffrey LeBlond. Anyway, they have some instructions on how to setup
application level error handling. Most...
|
by: James |
last post by:
Hello,
I have written a simple logon page that redirects to another page when
successful. All works fine on my computer but when I upload it I get the
error message below.
I have written it...
|
by: Tonio Tanzi |
last post by:
I have the following problem in a Win 2000 Server + SQL Server 2000
environment and I hope somewhat can help me to resolve it (after many
days of useless attempts I am desperate).
In my database...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |