Hi all,
I have a codeunit that works with an SQL db stored at the same SQL server as the NAV db, using ADO connections.
Everything is working great, but there is an annoying compilation error that appears only when I try to compile the codeunit the first time I open the NAV db, then when I recompile (sometimes I have to do it several times) - it disappears.
Should I reopen the NAV db - and the error is there again.
The code that triggers an error:
ADOCommand.ActiveConnection := varADOActiveConnection;
Name DataType Subtype
- ADOCommand Automation 'Microsoft ActiveX Data Objects 2.8 Library'.Command
- varADOActiveConnection Variant
The error message is as follows:
This message is for C/AL programmers:
This data type is not supported by C/SIDE. You can access data from
any of the following data types:
VT_VOID, VT_I2, VT_I4, VT_R4, VT_R8, VT_CY, VT_DATE, VT_BSTR and VT_BOOL
So the question is - what is the reasoning behind such compiler behavior? And is there any way to avoid such compilation error?
Thanks in advance.
Comments
what I had to do if I remember correctly was set the adocommand to be a local variable.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks for your reply, ara3n.In my case, both variables are local.
I need to provide some information to the testing vendor - why does this compilation error appear, at least in some general terms, but I don't know what to reply :-k
NAV is getting confused with COM datatype by the ADO automation.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!