BLOB Fields over 1MB
Posted: Tue 09 May 2006 18:42
I am using Delphi7 and MyDAC 4.30.0.12 14.04.06 to store sound files in a LONGBLOB field. The code is below:
--------------------------------------------------------------------------
q := 'insert into tblsound (dtbegintime,dtendtime,szsector,sFacid,blobsound) ';
q := q + 'VALUES ';
q := q + '(:pdtbegintime,:pdtendtime,:pszsector,:psFacid,:pblobsound) ';
newsoundcommand.SQL.Text := q;
newsoundcommand.ParamByName('psFacid').Asstring := lfacEdit.text;
newsoundcommand.ParamByName('pszsector').Asstring := sectorcombobox1.text;
newsoundcommand.ParamByName('pdtbegintime').Asdatetime := G_StartTime;
newsoundcommand.ParamByName('pdtendtime').Asdatetime := G_EndTime;
newsoundcommand.ParamByName('pblobsound').DataType := ftBlob;
newsoundcommand.ParamByName('pblobsound').LoadFromfile(Mypath + '7Minutes.wma', ftBlob);
newsoundcommand.Execute;
--------------------------------------------------------------------
The 7Minutes.wma file is just over a 1Meg.
This code will Immediatly generate a error EMYSQLException ..."Lost Connection to Mysql server during query".... Socket Error on Write...WASGetLastError Return 10054....
I can use the same code with the file 6Minutes.wma (about 900K) and it works fine.
This code runs after the MySQLConnection is made.
I have set the MAX_ALLOWED_PACKET to 1GB in the MySQL Server and it still does not help
I sure could use some help on this
Thanks
--------------------------------------------------------------------------
q := 'insert into tblsound (dtbegintime,dtendtime,szsector,sFacid,blobsound) ';
q := q + 'VALUES ';
q := q + '(:pdtbegintime,:pdtendtime,:pszsector,:psFacid,:pblobsound) ';
newsoundcommand.SQL.Text := q;
newsoundcommand.ParamByName('psFacid').Asstring := lfacEdit.text;
newsoundcommand.ParamByName('pszsector').Asstring := sectorcombobox1.text;
newsoundcommand.ParamByName('pdtbegintime').Asdatetime := G_StartTime;
newsoundcommand.ParamByName('pdtendtime').Asdatetime := G_EndTime;
newsoundcommand.ParamByName('pblobsound').DataType := ftBlob;
newsoundcommand.ParamByName('pblobsound').LoadFromfile(Mypath + '7Minutes.wma', ftBlob);
newsoundcommand.Execute;
--------------------------------------------------------------------
The 7Minutes.wma file is just over a 1Meg.
This code will Immediatly generate a error EMYSQLException ..."Lost Connection to Mysql server during query".... Socket Error on Write...WASGetLastError Return 10054....
I can use the same code with the file 6Minutes.wma (about 900K) and it works fine.
This code runs after the MySQLConnection is made.
I have set the MAX_ALLOWED_PACKET to 1GB in the MySQL Server and it still does not help
I sure could use some help on this
Thanks