[Compilation Error] Codeunit that uses ADO and VARIANT.

Sl1m4er
Member Posts: 42
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:
The error message is as follows:
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.
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.
0
Comments
-
It's a bug,
what I had to do if I remember correctly was set the adocommand to be a local variable.0 -
ara3n wrote:It's a bug,
what I had to do if I remember correctly was set the adocommand to be a local variable.
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 :-k0 -
you can try with newer exe and see if you still get the error.
NAV is getting confused with COM datatype by the ADO automation.0 -
[Topic moved from 'NAV Three Tier' forum to 'NAV/Navision Classic Client' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions