Home > Back-end >  Can help to write an example of a Delphi realize multithreading type queries
Can help to write an example of a Delphi realize multithreading type queries

Time:09-28

The company wrote a small program, data query because of the need to connect to multiple database query, outside interface card dead always happen, heard that make line program can solve this problem, which is a great god can you give an example reference?

CodePudding user response:

In addition, using ado to query oracle, thank you!

CodePudding user response:

When using a multithreaded if you want to access the VCL can only use an exclusive way, I also use multithreading but when operating, or would you like a single thread can't do other things, or exit is error.

CodePudding user response:

I give you the example:

CodePudding user response:

Type//multi-threaded -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
TMyThread_KHFX=class (TThread)
Protected
Procedure the Execute; Override.
Procedure checkdh;
end;
Procedure TMyThread_KHFX. Checkdh;
The begin
FrmTGZX_XSLTODB. CHECK_KHDHSTAT;
end;
Procedure TMyThread_KHFX. Execute;
The begin
The synchronize (checkdh);//thread exclusive way if it's not the synchronize can do other operations when executing thread, but exit the program error! ~ ~
end;
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
  • Related