Results 1 to 4 of 4

Thread: Connection to Server

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    Connection to Server

    Hi

    To connect to server below is the code . If due to some reasons server is down it takes a long time to give error message . I am using Sql Server 2008R2

    cnn2 is to connect to server

    If cnn2.State Then cnn2.Close
    cnn2.Open "Driver=SQL Server;Server=" & SvrName & ";Database=" & "test" & ";uid=" & Suid & ";pwd=" & Spwd & ";"

    cnn2.BeginTrans
    On Error GoTo errhandler

    str = "Insert statement"
    cnn2.Execute str
    cnn2.CommitTrans

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Connection to Server

    Yes - it does take a long time to get a failure message. Are you expecting it to be instantaneous?

    The default is 15 seconds - if you want it to be shorter do this

    http://msdn.microsoft.com/en-us/libr...v=vs.110).aspx

    I've only ever increased the timeout - never made it shorter

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    Re: Connection to Server

    Hi szlamany

    It is taking more time if connection is failed , if it is connected then it is fast . How i can improve connection speed . It is taking more than 1 minute to give connection error message.

    Thanks

  4. #4
    New Member
    Join Date
    Nov 2014
    Posts
    2

    Re: Connection to Server

    I have an vbasic script that updates a webpage database records.

    The script updates additions and deletions, but will not update field changes, this is because the run is pointing to an old server InetPub (I recently updated to the Arvixe host site) and produces the error message below

    Microsoft JET Database Engine error '80004005'

    'E:\InetPub\esvc000072\DB\NetBooklist.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

    /newadmin/ApplyDB.asp, line 199

    The script is run at http://musick-cokerybooks.com/newadmin/ and then click here at item 4.

    the script is applydb.asp which calls common.asp where the server is assigned
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width