Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting

Post new topic   Reply to topic
How to execute several stored procedures asynchronous in VB6
View previous topic :: View next topic  
Author Message
hpecon@hotmail.com
Newbie


Joined: 01 Mar 2005
Posts: 4
Location: Norway

PostPosted: Jan 31st, 2006 06:29 AM    Post subject: How to execute several stored procedures asynchronous in VB6 Reply with quote

Hi

I have a sequence of 20 - 40 procedures that need to run asynchronous against the database. Each sequence takes about a minute to execute and I can't afford not do do this asynchronous.

I have a large set of classes but there are only three that needs to be investigated
CItems (The collection for CItem)
CItem
CDBAsync (Dababase connection)

CDBAsync handles the connection to the database, I have created events for the ADODB.Connection. The class has a procedure called ExecuteProc that fires the Execute method in ADODB.Connection

CItem is one of 20 - 40 procedures that need to run Asynchronously. The stored procedure is Executed with a procedure called Execute

private withevents m_con as CDBAsync
Sub Execute (sProc as String)
m_con.Execute sProc, , adExecuteAsync
end Sub

In CItems I have a procedure called ExecuteBatch

Private m_lCount as Long
Private m_oCol as Collection
Private withevents m_oItem as CItem

Sub ExecuteBatch
for i = 1 to m_lCount ' number of CItem
set m_oItem = m_oCol(i)
m_oItem.Execute
next i

When I run ExecuteBatch it fires off all my CItem's but when I'm using the event m_con_ExecuteComplete I can't find back to the correct CItem that has completed the execution.

I tried to use the ADODB.Command and the Name property but I only get a Run-timer error '3219' - Operation is not allowed in this context

Can someone please help me

I can't write down all code in the classes but If anyone out there can help I'll be happy to send the original classes for further information about the problem

Best Regards
HPE
Back to top
View user's profile Send private message
VB_Developer
Newbie


Joined: 25 Feb 2006
Posts: 18
Location: Hyderabad, India

PostPosted: Feb 26th, 2006 09:03 AM    Post subject: Reply with quote

Hi,
Could you please post your database and your class files, so i could post you the solution.

Thanks
Back to top
View user's profile Send private message
hpecon@hotmail.com
Newbie


Joined: 01 Mar 2005
Posts: 4
Location: Norway

PostPosted: Feb 27th, 2006 03:37 AM    Post subject: How to execute several stored procedures asynchronous in VB6 Reply with quote

Hi VB_Developer

I found the solution to my issue.

HP
_________________
HP
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic