Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old September 4th, 2003, 05:23 PM
okami okami is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 okami User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ADO connection

One of my ADO queries takes more than 30 seconds to execute and I want to use a progress bar to show the query is still progressing. Can I use the Connection.StillExecuting
statement to work out whether the query is still connecting or executing?

Reply With Quote
  #2  
Old September 10th, 2003, 09:25 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via MSN to cleverpig
It's not the best way!
U Can use while statement and a timeout function to judge Connection.state.

This is the timeout function:
Public Function TimeToQuit(TimeToWait As Long) As Long

'PURPOSE: Returns a TimeOut value, in metric
'Seconds from Midnight (i.e., return value of Timer function)
'taking into account that Midnight may occur within the elapsed time

'PARAMETER: TimeToWait: Number of Seconds to Wait

'RETURN VALUE: When to TimeOut, in Seconds From Midnight

'EXAMPLE: Implements a 30 second timeout before giving
'up on a winsock Connection

'Dim lWaitUntil as Long
'lWaitUntil = TimeToQuit(30)
'Winsock1.Connect
'Do Until Winsock1.State = sckConnected or Timer > _
' lWaitUntil
' DoEvents
'Loop
'If Winsock1.State = sckConnected Then
' MsgBox "Connection Successful"
'Else
' MsgBox "Connection TimedOut
'End If
'*************************************************************
Dim lStart As Long
Dim lTimeToQuit As Long
Dim lTimeToWait As Long

lStart = Timer
lTimeToWait = TimeToWait

If lStart + TimeToWait < 86400 Then
lTimeToQuit = lStart + lTimeToWait
Else
lTimeToQuit = (lStart - 86400) + TimeToWait
End If

TimeToQuit = lTimeToQuit

End Function

Reply With Quote
  #3  
Old September 11th, 2003, 04:44 PM
okami okami is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 okami User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What a detailed response! Thanks so much, that was really helpful!

Reply With Quote
  #4  
Old September 11th, 2003, 10:21 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via MSN to cleverpig
It's the honor of all Developers !

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > ADO connection


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway