Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO

Status
Not open for further replies.

GCTIberica

Programmer
Jun 20, 2003
30
ES
OK, I have a problem and I would love a little bit of help!
I have a client server application. The server has an ADO connection to the SQLServer DB. At the minute there are about 25 clients which constantly hit the server. Soon, there will be over 200 clients! However, the problem is that the ADO doesn´t seem to deliver all hits to the database.
So, I changed the code so there are 2 ADOQueries instead of one, which access the database depending on the procedure, to try to eliminate any concurrency problems. What a hack! It seems to work quite well, but as you can imagine, I need to change the code, so it works properly.
OK, I am a bit confused, because ADO should be able to handle these problems. Does anyone know of any way to get around this problem?

Thanks in advance
 
How does the client connect to the Server??? is it a multi-threaded server? if so, have you set the CoInitFlags anywhere?

I alway add:

CoInitFlags:= COINIT_MULTITHREADED;

to my project source, as this allows ADO connections to operate correctly in a multi-threaded environment.

Heres an example of the source for one of my projects:


program IrisTest;

uses
Forms,
ActiveX,
ComObj,
TCPClient in 'TCPClient.pas' {TCPClientForm};

{$R *.res}

begin
CoInitFlags:= COINIT_MULTITHREADED;
Application.Initialize;
Application.Title := 'IrisTester';
Application.CreateForm(TTCPClientForm, TCPClientForm);
Application.Run;
end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top