I have to send a XML file to a stored procedure of SQL Server (i tried 2005 and 2008 R2).
I'm using BSD 2006 and Unidac 3.70.017 (I tried the lastest Unidac in trial version too).
When i send a tiny file (<8k) it work fine, but with a bigger file i have this error:
The TUniConnection initialisation:OLE DB error occured. Code 80040E07h.
Code: Select all
FServerCnx.ProviderName:=FDBType;
FServerCnx.SpecificOptions.Values['Direct']:= 'True';
FServerCnx.LoginPrompt :=False;
FServerCnx.Connected := False;
FServerCnx.SpecificOptions.Values['ThreadSafety']:= 'True';
FServerCnx.SpecificOptions.Values['ConnectionTimeout'] := '3000'; //3s
FServerCnx.Server:=FIPAdress;
FServerCnx.Username:=FUser;
FServerCnx.Password:=FPassword;
FServerCnx.Database:=FSchema;
FServerCnx.Port:=StrToInt(FPort);Code: Select all
AssignFile(afile, 'C:\TEST_XML\TEST.XML');
Reset(afile);
SetLength(buffer, FileSize(afile));
For i := 1 to FileSize(afile) do
Read(afile, buffer[i - 1]);
CloseFile(afile);
SetString(AnsiStr, PAnsiChar(@buffer[0]), Length(buffer));
FDBQuery.SQL.Clear;
FDBQuery.SQL.add('EXEC dbo.PROC_UPDATE_XML :xml_datas;');
FDBQuery.parambyname('xml_datas').AsBlob:= AnsiStr;
FDBQuery.parambyname('xml_datas').paramtype:=ptInput;
FDBQuery.ExecSQL;Regards,
Gaby23.