472,352 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

Threading Commands

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
connection. My threading class copies the command and creates a new
connection for it using the main connection's connect string, but those
don't seem to open correctly. This is the constructor for my AsyncDBCommand

Public Sub New(ByVal Cmd As OleDbCommand, ByVal ParamArray Params() As

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_Thread = New Threading.Thread(AddressOf Me.DoAsyncCmd)


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?

Michael Caputo
Programmer/Database Administrator
Simon Economic Systems Ltd.
Nov 20 '05 #1
0 968

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Ognjen Bezanov | last post by:
Hi, all Thanks all of you who helped me with the threading and queues issue. I am trying to get it working but I am having problems. When I try...
by: amit | last post by:
Hello, I am embedding a python script in a C++ application. The script can be called simultaneously from multiple threads. What is the correct...
by: Vadym Stetsyak | last post by:
Hello! I've got a class, representing Windows Form (Form1); When I launch new thread user interface e.g. Form1 stops responding until the worker...
by: Benoit Martin | last post by:
Hi, I've had my application going back to desktop randomly when executing ShowDialog commands. I posted to this list and was asked to post code...
by: Perecli Manole | last post by:
I have a background worker thread that receives queued work items and processes them. How do I make this background thread go in a sleep state...
by: richard | last post by:
OS: Winxp and Win2003 Visual Basic.NET 2003 MS-SQL Server 2000 hey all I am a newbie in vb.net but i have managed to build a simple chat...
by: half.italian | last post by:
Hi all, I don't really understand how to properly use threading in my programs, however I have managed to get by so far using them improperly. ...
by: =?Utf-8?B?TWljaGFlbCBNYWVz?= | last post by:
Hello, I have an Mdi-application which also is a remoting-server (Ipc). Several instances can co-exist on the same machine. I have a small app...
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.