Hello,
I am trying to do the following, not very successful until now. Maybe somebody can give me a hint.
Basically I want to create a XML file in Navision and store it into an external table.
1. I do not use XML ports, I am building the XML in a codeunit and store it into a Navision BLOB field. This is done already.
2. Now I want to copy / insert the BLOB field into a remote NON-Navision table on a SQL server.
This is not working as intended.
If I read binary from a file and insert it into the SQL table the field contains the binary characters which are not usable.
ADOStream.Type:=1;
ADOStream.Open;
ADOStream.LoadFromFile(idoc2filename);
ADORecSet.Fields.Item('XMLFIELD').Value :=ADOStream.Read;
ADORecSet.Update;
If I read as text, then the text seems to be too long. Error is (The length of the text string exceeds the size of the string buffer.)
ADOStream.Type:=2;
ADORecSet.Fields.Item('XMLFIELD').Value :=ADOStream.ReadText;
Are there other ways to do this?
Christian
I am trying to do the following, not very successful until now. Maybe somebody can give me a hint.
Basically I want to create a XML file in Navision and store it into an external table.
1. I do not use XML ports, I am building the XML in a codeunit and store it into a Navision BLOB field. This is done already.
2. Now I want to copy / insert the BLOB field into a remote NON-Navision table on a SQL server.
This is not working as intended.
If I read binary from a file and insert it into the SQL table the field contains the binary characters which are not usable.
ADOStream.Type:=1;
ADOStream.Open;
ADOStream.LoadFromFile(idoc2filename);
ADORecSet.Fields.Item('XMLFIELD').Value :=ADOStream.Read;
ADORecSet.Update;
If I read as text, then the text seems to be too long. Error is (The length of the text string exceeds the size of the string buffer.)
ADOStream.Type:=2;
ADORecSet.Fields.Item('XMLFIELD').Value :=ADOStream.ReadText;
Are there other ways to do this?
Christian