Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Giving some feedback to user, when waiting on SQL SELECT query to finish

Hi.

I'm performing a normal SELECT query from Microsoft SQL Server via
ADODB. The line of code which performs the query is a simple:

rsdata.Open sSQL, sConnect, adOpenStatic, adLockReadOnly, adCmdText

Now, the query pulls out anything between 200 and 1600 records, and I
was wondering if I can somehow inform the user that the macro is still
alive, so that I'm sure he doesn't try to kill Excel.

Is it possible to wrap it up so that eg every 5 seconds the macro runs
another line of code saying sth like "Still waiting" or is it
completetly uncontrollable once it's communicating with the SQL server?

Thanks,
Morris

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Giving some feedback to user, when waiting on SQL SELECT query to finish

I believe that Excel provides some info in the Status Bar at the bottom left
while queries are running. You might ensure that the status bar is visible
before running the query. Read VBHelp on how to capture the status bar
current condition, set it to what you want during macro and putting it back
to the way the user had it originally.
Mike F
"Morris" wrote in message
ups.com...
Hi.

I'm performing a normal SELECT query from Microsoft SQL Server via
ADODB. The line of code which performs the query is a simple:

rsdata.Open sSQL, sConnect, adOpenStatic, adLockReadOnly, adCmdText

Now, the query pulls out anything between 200 and 1600 records, and I
was wondering if I can somehow inform the user that the macro is still
alive, so that I'm sure he doesn't try to kill Excel.

Is it possible to wrap it up so that eg every 5 seconds the macro runs
another line of code saying sth like "Still waiting" or is it
completetly uncontrollable once it's communicating with the SQL server?

Thanks,
Morris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Giving some feedback to user, when waiting on SQL SELECT query to finish

You can declare your recordset "with events" and use the events to trigger
message updates (on a userform?)

http://windowssdk.msdn.microsoft.com.../ms677579.aspx

Depends really on if the delay is mostly before getting any records, or
between getting the first and last record. At least if you use ADO
asynchronously it won't lock up Excel while they're waiting...

Tim


"Morris" wrote in message
ups.com...
Hi.

I'm performing a normal SELECT query from Microsoft SQL Server via
ADODB. The line of code which performs the query is a simple:

rsdata.Open sSQL, sConnect, adOpenStatic, adLockReadOnly, adCmdText

Now, the query pulls out anything between 200 and 1600 records, and I
was wondering if I can somehow inform the user that the macro is still
alive, so that I'm sure he doesn't try to kill Excel.

Is it possible to wrap it up so that eg every 5 seconds the macro runs
another line of code saying sth like "Still waiting" or is it
completetly uncontrollable once it's communicating with the SQL server?

Thanks,
Morris



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2002 - What is the RUL for user feedback and suggestions ? Mr. Low Excel Discussion (Misc queries) 3 September 4th 07 08:04 PM
waiting Query result Paolo9001 Excel Programming 1 May 23rd 06 11:42 AM
programmatically add Outlook control for user interaction/feedback Loane Sharp[_2_] Excel Programming 0 May 13th 06 09:24 AM
Waiting Mode when query data from Db via VBA! Microlong Excel Programming 4 February 18th 05 10:17 AM
Microsoft excel is waiting for other program to finish OLE Action Deepak[_4_] Excel Programming 1 November 13th 03 10:11 AM


All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"