Very slow speed when adding a record
Posted: 05.02.2008, 17:21
In my application I have to insert a record into a remote table. I use a TzConnection and a TzQuery in Delphi 5. After connected the TzConnection I use this code:
The FS is a tFileStream of about 6 kbytes.
The software does this operation many times and everything works fine, but the speed remain around 1 kbyte/sec.
The server and the client are connected to Internet with ADSL (I tried to upload one file in the server via FTP, the speed was around 30 kbyte/sec). On the server there's a MySQL v. 5.0.22,
the version of ZeosLib is 6.6.2-RC.
Why the speed is so low? Where I am wrong?
Thank you
Code: Select all
ZQuery.SQL.Text:='SELECT * FROM table';
ZQuery.Open;
ZQuery.Insert;
ZQuery.FieldByName('id').AsInteger:=Id;
ZQuery.FieldByName('data').AsDateTime:=data;
TBlobField(ZQuery.FieldByName('image')).LoadFromStream(FS);
ZQuery.Post;
ZQuery.Close;
The software does this operation many times and everything works fine, but the speed remain around 1 kbyte/sec.
The server and the client are connected to Internet with ADSL (I tried to upload one file in the server via FTP, the speed was around 30 kbyte/sec). On the server there's a MySQL v. 5.0.22,
the version of ZeosLib is 6.6.2-RC.
Why the speed is so low? Where I am wrong?
Thank you