Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


How to do a wait timeout in VB Script?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,27610
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to do a wait timeout in VB Script?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 How to do a wait timeout in VB Script? - 11/1/2005 2:39:43 AM   
  marclevesque

 

Posts: 6
Score: 0
Joined: 11/1/2005
Status: offline
Original message moved by mbouchard
Reason : Moving to appropriate forum
I execute a SQL query to get a RecordSet... but the result is coming after the next line of code.
How can I put a wait until timeout between my RS.Open and the condition If not RS.Eof ?
Thank you for your help!
 
 
Post #: 1
 
 RE: How to do a wait timeout in VB Script? - 11/1/2005 5:36:35 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
Wscript.Sleep 10000 '10 sec. time-out

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to marclevesque)
 
 
Post #: 2
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 2:00:53 AM   
  marclevesque

 

Posts: 6
Score: 0
Joined: 11/1/2005
Status: offline
I got an error when I use WScript.Sleep. Why? I use Windows XP Pro.

(in reply to Snipah)
 
 
Post #: 3
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 2:30:10 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: online
Are you doing this within a webpage? If so then WScript.Sleep is not available.

(in reply to marclevesque)
 
 
Post #: 4
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 2:32:25 AM   
  marclevesque

 

Posts: 6
Score: 0
Joined: 11/1/2005
Status: offline
Not within a web page. I use an ActiveX task in a local package of SQL Server.

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 2:47:25 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: online
Aah...that may have the same restrictions on WScript...I'm not sure.

(in reply to marclevesque)
 
 
Post #: 6
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 3:02:22 AM   
  marclevesque

 

Posts: 6
Score: 0
Joined: 11/1/2005
Status: offline
Then, is exist another way to do a wait timeout in my code?

(in reply to ebgreen)
 
 
Post #: 7
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 3:12:05 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: online
Try posting the code that you have now and point out where you wan the pause to be.

(in reply to marclevesque)
 
 
Post #: 8
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 3:27:44 AM   
  marclevesque

 

Posts: 6
Score: 0
Joined: 11/1/2005
Status: offline
set cn = CreateObject("ADODB.Connection") 
set rs = CreateObject("ADODB.Recordset")
cn.ConnectionString = "Provider=sqloledb;Data Source=SQLLSERV;Initial Catalog=internal;Integrated Security=SSPI;" 
cn.Open
sqlLookup = "select top 1 cFileId from dbo.BWR_GETINFO_RESULTS"
sqlLookup = sqlLookup + " where cFileId > '" & DTSGlobalVariables("fileid").value & "'"
sqlLookup = sqlLookup + " order by cFileId"
set rs.ActiveConnection = cn
rs.Open sqlLookup, cn, adLockReadOnly
***
*** need a wait timeout here
***
if not rs.Eof then
...
end if

(in reply to ebgreen)
 
 
Post #: 9
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 5:48:09 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: online
The code does not automatically wait for the results? I have some code that does some pretty long (time wise) queries and it has always been synchronous for me.

(in reply to marclevesque)
 
 
Post #: 10
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 5:54:13 AM   
  marclevesque

 

Posts: 6
Score: 0
Joined: 11/1/2005
Status: offline
> The code does not automatically wait for the results?
Not always, sometimes it seems not.

(in reply to ebgreen)
 
 
Post #: 11
 
 RE: How to do a wait timeout in VB Script? - 11/2/2005 7:56:10 AM   
  Mindmesh

 

Posts: 78
Score: 0
Joined: 11/23/2004
From:
Status: offline
Well I know this isn't a standard way to do it but you could put in a loop that loops until the record is pulled. I sort of did that in one of my scripts.
You may be able to do something like this:

For x = 0 to 100000
   x++
Next

I dont' know if it will help, but it's worth a shot.

(in reply to marclevesque)
 
 
Post #: 12
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to do a wait timeout in VB Script? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts