If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > HOWTO Run a Query asynchronously

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-03, 07:57
coroner coroner is offline
Registered User
 
Join Date: Jul 2002
Posts: 87
HOWTO Run a Query asynchronously

Is there a possibility to execute a Query (with browsable recordsets after opening) asynchronously?

E.g. something like
rs.open ...
while not rs.complete
response.write "Opening..."
wend
and then...
while not rs.eof
response.write rs("id") & "<br>" & vbcrlf
rs.movenext
wend

I know that I can do that trough rs.open "...",3,1,16
and loop trough the rs.state afterwards - the problem is that IIS freezes until that query has finished, whatever I do...

Is there another possibility than to schedule snapshot-table-creator on sql?

thanks for any post!!
best regards

Last edited by coroner; 07-09-03 at 09:01.
Reply With Quote
  #2 (permalink)  
Old 07-10-03, 20:59
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
I don't belive so, but I may be wrong...I have never come accross it or ever really needed it.

With regards to scheduling a snapshot-table-creator on sql?

Firstly I take it you mean in Microsoft SQL Server, not in SQL?

If you do I guess you can. I know that you should be able to do this in Oracle with a DBMS_job and some PL/SQL code - it should be fairly easy. I don't really know how I would do it in Microsoft SQL Server, but I am sure it can be done, just schedule a job (I know you can do this) and write some code to create/populate a tempory table every now and then.

NB, you will probably need to have two tempory tables, being pointed at by a view (that shows all the records from one); this will allow your code to update one table, whilst still allowing the data in the other to be read from, once the table is updated the view would be changed to point to the updated table. If you don't do this, you will have to find a solution for the senario of someone requesting a page/doing something which used that table (which could be empty/locked etc)...
Reply With Quote
  #3 (permalink)  
Old 07-11-03, 20:33
coroner coroner is offline
Registered User
 
Join Date: Jul 2002
Posts: 87
Hello Russel,
Im doint it trough hourly generated tables currently (as a step to the perfect solution ).

I just meant - is there no possibility to stop IIS from working on ASPS while doint a rs.open?

E.g. if I'm waiting in the original loop until rs.state=4, no other ASP page will work - everything freezes until the long-query-asp is finished...

Best Regards...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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