[solved] access ADO field value thru ComObj, Variants lazarus / 16-Databases ---------------------------------------------------------------------- CapelliC · 2020-06-25 15:04 So far, the COM interface provided by CreateOLEObject('ADODB.Connection') is working for my purpose. It also serve collection items easily. But when I try to get the Field.Value I have this error 'EVariantInvalidOpError' with message Invalid variant operation. Any hint to bypass this problem ? Have tried some silly workaround, like using VarCopyNoInd (just to find it's not implemented actually...) Another quirk... while Field properties like Name are available, the Type cannot be obtained. The compiler complains about     writeln(field_a.type); // ko my_test.pas(79,21) Fatal: Syntax error, "identifier" expected but "TYPE" found I think the two problems are related, since seems the compiler does know about IDispatch. Of course, a mere supposition... TIA for any help ---------------------------------------------------------------------- korba812 · 2020-06-25 15:17 To use identifiers with restricted names (like pascal keywords) you must precede the identifier name with '&': Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i writeln(field_a.&type); ---------------------------------------------------------------------- CapelliC · 2020-06-25 15:34 Thanks, that's useful. Free Pascal is a rather large topic and I have a lot to learn... ---------------------------------------------------------------------- CapelliC · 2020-07-21 13:57 Seems I was calling the wrong COM initialization function. Instead of CoInitialize, now I call CoInitializeEx(nil,0) and the problem seems to be solved.