Setting the timeout

Visual Basic

Setting the timeout

Postby Q2xheQ » Wed, 28 Jan 2004 01:56:06 GMT

Hello

One of our programs writes to an access database.  It does this very quickly, and there are a lot of inserts into one table.  Recently I was asked to write some code to cache failed inserts.  Once inserts started happening properly again, the cache would also be written.  But there is a problem

I need to be able to set the timeout for fails in DAO.  Right now I believe DAO, through jet, retries writing to a database 3 times, and tries for 5 seconds apiece.  Thats a max of 15 seconds to know that it has actually failed, which is way too long. 2 seconds is way to long for what we need. Is there any way to make it so that it tries once, for a maximum of one second, and then fails

If anyone knows how to do this could they let me know?  I'd appreciate it immensly!  Thanks and have a great day!

Similar Threads:

1.setting a timeout for web service response

I have a windows app that calls a web service.  If the web service 
requires more than 20 seconds to reply I would like to timeout waiting 
for a response from it and proceed on with processing.  Is there any way 
to set a timeout?

It's a windows form application and the web service is legacy asp.net.

2.Set Single_User Timeout Error

Hi -

I'm have a VB.NET Windows application that uses an MSDE database.  I'm
trying to code backup, restore, and checkdb/repair functions.

Before each of these operations, I change the connection database to
"master" and then execute an "ALTER DATABASE SC01 SET SINGLE_USER"
statement.  Very occasionally, this progression works fine.  But most of the
time, I get a Timeout expired error on the set single-user command.  I've
tried setting commandtimeout to 60, and I get the same result (it just takes
longer).

What am I doing wrong, and/or how can I get these functions to work
correctly and reliably??

My database name is 'SC01'.  The connection string for conSCdata is "packet
size=4096;user id=sa;data source="(local)\InstName";persist security
info=True;initial catalog=SC01;password=SPassword" (and the connection is
open).  I have already created SCBackupDevice using sp_addumpdevice.

Here's my code for the backup operation:

      frmMain.conSCdata.ChangeDatabase("master")

      strSQL = "ALTER DATABASE SC01 SET SINGLE_USER"
      SQLcmd = New SqlCommand(strSQL, frmMain.conSCdata)
      SQLcmd.ExecuteNonQuery()
      SQLcmd = Nothing

      strSQL = "BACKUP DATABASE SC01 TO SCBackupDevice"
      SQLcmd = New SqlCommand(strSQL, frmMain.conSCdata)
      SQLcmd.ExecuteNonQuery()
      SQLcmd = Nothing

      strSQL = "ALTER DATABASE SC01 SET MULTI_USER"
      SQLcmd = New SqlCommand(strSQL, frmMain.conSCdata)
      SQLcmd.ExecuteNonQuery()
      SQLcmd = Nothing

      frmMain.conSCdata.ChangeDatabase("SC01")


Thanks for your help.

- Jeff


3.How to set a timeout

I have a windows application that is using a webservice to get some
information used in the program. However, when I use the program
behind a firewall, the program just hangs there, trying to access this
webservice all the time, without reaching it. How can i set a timeout
in my program that can make it stop trying to reach that webservice?

Try
   rate = objExchange.getRate(strCountry1, strCountry2)
   lblUpdate.Text = "Last updated: " & Date.Now
   Catch ex As Exception
       lblUpdate.Text = "Connection failed"
End Try
lblKurs.Text = rate


Anyone have any suggestions? Thank you in advance,
Hurley

4.Setting the timeout for retries when writing to access

We are currently writing to an Access database using DAO.  What we need to know is if there is any way to set the timeout time to write to the database through code in milliseconds.  for instance, right now the timeout is set at 1 second.  We need to set the timeout at 100 milliseconds.

If there is any way to do this using DAO that would be preferable, however, if the only way we can do it is by switching to ADO we will gladly do it.

If anyone can help it'd be greatly appreciated!  Thanks!

5.Setting FTP timeouts

How do I change the FTP timeout. I have a FTP server that sometimes gets bogged down and I want to change the FTP timeout to be longer so my PC doesn't timeout.

6. How to set a timeout on a send method?

7. Setting web service timeout in vb.net - Cor Ligthert[MVP]

8. Setting web service timeout in vb.net



Return to Visual Basic

 

Who is online

Users browsing this forum: No registered users and 0 guest