I'm connecting to a DB on a dual-processor 2.8 Ghz server with 2.5 gig RAM.
So I've got plenty of muscle, and I'd like to do double-time on one update
command. The command calls a stored procedure that receives two variables.
I've got the threading class set up, but I keep running into a problem with
the
connection. My threading class copies the command and creates a new
connection for it using the main connection's connect string, but those
connections
don't seem to open correctly. This is the constructor for my AsyncDBCommand
class:
Public Sub New(ByVal Cmd As OleDbCommand, ByVal ParamArray Params() As
Object)
Dim i As Short
Dim obj As Object
Dim p As OleDbParameter
m_Cmd = Cmd
Parameters = Params
End Sub
and the thread initializer:
Public Sub RunCmd()
m_Cmd.Connection = New OleDbConnection(RADAR.ConnectionString)
m_Cmd.Connection.Open()
m_Thread = New Threading.Thread(AddressOf Me.DoAsyncCmd)
m_Thread.Start()
End Sub
This works fine as long as I only call the command once and then use Join.
But if I call it twice in a row, I get an invalid operation error in my
generic command caller on the line where it checks to see if the command
passed to it has an open connection. For some reason, even though I open
the connection from within the AsyncDBCommand class, it reads as Closed and
then can't open. Any suggestions?
Thanks,
Mike
--
Michael Caputo
Programmer/Database Administrator
Simon Economic Systems Ltd.
847-272-7691
mi************@radarwire.com