Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    2

    Post Unanswered: SQL Server Timeout problem

    Hi ,

    I am running web application on windows 98 using sql server 2000 as backend. in ASP page i am using connectionstring and trying to insert some data into the database using command object. but i am getting an error message like this.

    Timeout expired.

    Sql server does not exist or access is denied.

    below is the set of code which i have used

    Dim strcon,objcmd,objrs
    strcon= "Provider =SQLOLEDB;server =Servername;database=databasename;uid=username;pwd =password"
    Set objcmd=Server.createobject("ADODB.command")
    Set objrs=Server.createobject("ADODB.Recordset")
    objcmd.activeconnection=strcon
    objcmd.commandtext="insert into details(empcode,join_date) values('"&empcode&"','"&joindate&"')"
    objcmd.commandType=adCmdText
    set objrs =objcmd.execute()
    if not objrs.eof then
    arrResults =objrs.getrows()
    end if
    Can anyone pls help me to avoid this problem>

    Subramanian N G

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    hello,
    I recieve this error lot many times.Actually there are many reason why u could get this error like when certain cpu extensive activities are going on on the database server or the server is busy or you would have to check u'r remote query timeout option or the remote login timeout option in the database.
    regards,
    Harhsal.

  3. #3
    Join Date
    Dec 2002
    Posts
    1,245

    Re: SQL Server Timeout problem

    Although it may just be a semantic difference, I would re-write the code as follows:

    Code:
    Dim strcon, objCmd, objRS, objConn
    
    strcon= "Provider =SQLOLEDB;server =Servername;database=databasename;uid=username;pwd=password"
    
    Set objConn=Server.CreateObject("ADODB.Connection")
    Set objcmd=Server.createobject("ADODB.command")
    Set objrs=Server.createobject("ADODB.Recordset")
    
    objConn.ConnectionString = strCon
    objConn.Open
    
    If objConn.State = 1 ' or adStateOpen Then
      set objcmd.activeconnection = objConn
      objcmd.commandtext="insert into details(empcode,join_date) values('"&empcode&"','"&joindate&"')"
      objcmd.commandType=adCmdText
      set objrs =objcmd.execute()
      if not objrs.eof then
       arrResults =objrs.getrows()
      end if
    End if
    The only difference is that I am using the ADO connection object and opening the connection in a separate line prior to passing the execution statement. I'm really not certain if it will make any difference to you or not.

    Regards,

    Hugh Scott

    Originally posted by subramng
    Hi ,

    I am running web application on windows 98 using sql server 2000 as backend. in ASP page i am using connectionstring and trying to insert some data into the database using command object. but i am getting an error message like this.

    Timeout expired.

    Sql server does not exist or access is denied.

    below is the set of code which i have used

    Dim strcon,objcmd,objrs
    strcon= "Provider =SQLOLEDB;server =Servername;database=databasename;uid=username;pwd =password"
    Set objcmd=Server.createobject("ADODB.command")
    Set objrs=Server.createobject("ADODB.Recordset")
    objcmd.activeconnection=strcon
    objcmd.commandtext="insert into details(empcode,join_date) values('"&empcode&"','"&joindate&"')"
    objcmd.commandType=adCmdText
    set objrs =objcmd.execute()
    if not objrs.eof then
    arrResults =objrs.getrows()
    end if
    Can anyone pls help me to avoid this problem>

    Subramanian N G

  4. #4
    Join Date
    Mar 2003
    Location
    Melbourne, Australia
    Posts
    6

    Lightbulb SQL Server Timeout

    Search for the application Cliconfg.exe, should be located in the windows root. You can specify default communication libraries to coommunicate with SQL Server. I would recommend at least TCP/IP

Posting Permissions

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