| View previous topic :: View next topic |
| Author |
Message |
hpecon@hotmail.com Newbie
Joined: 01 Mar 2005 Posts: 4 Location: Norway
|
Posted: Jan 31st, 2006 06:29 AM Post subject: How to execute several stored procedures asynchronous in VB6 |
|
|
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 |
|
VB_Developer Newbie
Joined: 25 Feb 2006 Posts: 18 Location: Hyderabad, India
|
Posted: Feb 26th, 2006 09:03 AM Post subject: |
|
|
Hi,
Could you please post your database and your class files, so i could post you the solution.
Thanks |
|
| Back to top |
|
hpecon@hotmail.com Newbie
Joined: 01 Mar 2005 Posts: 4 Location: Norway
|
Posted: Feb 27th, 2006 03:37 AM Post subject: How to execute several stored procedures asynchronous in VB6 |
|
|
Hi VB_Developer
I found the solution to my issue.
HP _________________ HP |
|
| Back to top |
|
|