Hi all,
I want to retrieve a value of type Image(blob in navision) from sql table and want to assign that value to one text variable( my blob contains only characters)
for that i have declared variables of type automation.
I chose following Automation Server
'Microsoft ActiveX Data Objects Recordset 2.5 Library'
CREATE(varrecord);
strsql:='select * from "Windowmaker Software Limited$Licence" where "Record id"=1';
strconnection:= 'Provider=SQLOLEDB;User Id=xyz;Password=xyz;Data Source=IM33;DATABASE=Navision Demodatabase';
varrecord.CursorType(0);
varrecord.CursorLocation(1);
varrecord.Open (strsql,strconnection);
varfield:= varrecord.Fields;
varfieldobj:= varfield.Item(19);
textvar:=varfieldobj.value; // gives an error here
Do i need to create a stream?
Please help.
0
Comments
If you work with a version that hasn't streams, you can write the BLOB to disk. Then open it with a File-variable and read it into your text-variable.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I am not sure if it is applicable to your case but...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
How can i create stream using varfieldobj, because that is the variable refering to the column of the table?
example with field Picture of Item-table
PS : if the BLOB-field in SQL in NOT a Navision-table, you need to create a Navision-table that points to that table (Table Property : "LinkedObject")
Or instead of doing this:
try this:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
because when you see the drop down menu in c/al globals blob is not there.
Thanks for any help
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Can you please explain your point in some detail? I am not able to understand it.
In the Item-table, there is a field "Picture". This field is a BLOB-field.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
blobvar Record Item
then if i write
blobvar:=varfieldobj.value
then it gives an run time error that multiple-step oledb generated errors.
then close the file.
Open the file with a text-editor to see if it has been written correctly.
If it is written correctly you can open the file to read and put everything directly in a text-variable.
Other possibility is still to create a Navision table with the same layout as the SQL-table and connect the Navision table directly to the SQL-table. In this case you can do a find for the record and you have it in your BLOB. Store that on disk and then open the file to read and put everything directly in a text-variable.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!