Hello and welcome to our community! Is this your first visit?
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
    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:

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

    Below is the close_reporter2.asp 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"))
    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!


  2. #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 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.
    Be yourself. No one else is as qualified.


Posting Permissions

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