Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Query Timeout

  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Timeout

    I have the following ASP code (snippet) that calls/links to another page. Below is the code snippet:

    Code:
    <a href="close_reporter2.asp?serial=<%response.write rsqdb("serial")%>"><%response.write rsqdb("serial")%></a>
    =========================================================================================

    Below is the close_reporter2.asp code:

    Code:
    <% Option Explicit %>
    <%
    Dim serverid, conn, rsqdb, rsUpdate, rs, objConnection, serial, acknowledged, strQuery, cmd
    
    Function ChkString(string)
    If string = "" Then string = " "
    ChkString = Replace(string, "'", "'")
    End Function
    
    serial = ChkString(Request.QueryString("serial"))
    acknowledged = ChkString(Request.QueryString("acknowledged"))
    Response.Buffer=False
    
    set Conn=Server.CreateObject("ADODB.Connection")
    set cmd = server.CreateObject("ADODB.Command")
    cmd.CommandTimeout = 600
    set rsUpdate = server.CreateObject("ADODB.Recordset")
    Conn.open "Provider=sqloledb;Server=nnn.nnn.nnn.nnn;Initial Catalog=reporter;UID=xxxx;PWD=xxxx;"
    
    strQuery = "select serial from [REPORTER].[reporter].[REPORTER_STATUS] with (NOLOCK) where (serial = '19917050') "
    
    %>
    Unfortunately, I keep getting a SQL query timeout error. I've run a SQL trace but nothing appears to wrong when the trace is run.

    Any ideas are appreciated!

    Dale

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,496 Times in 4,460 Posts
    So did you ever figure this out?

    First thing to do would have been to run the query
    select serial from [REPORTER].[reporter].[REPORTER_STATUS] with (NOLOCK) where (serial = '19917050')
    in your SQL Server management studio.

    I'm betting that you will get an error because of [REPORTER].[reporter]
    [REPORTER] will be the name of the database.
    [reporter] will be the name of the user.
    Note that neither of those are case sensitive. You would get the same result with [reporter][REPORTER] or even [rEPorTEr][repORTeR], etc.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •