Recent

Author Topic: [solved] why the compiler flags a parameter as a duplicate property declaration?  (Read 509 times)

CapelliC

  • Jr. Member
  • **
  • Posts: 58
Trying to compile ADODB.pas, that in turns references ADOInt.pas.
There, there at line 1312, I get an error I don't understand:


Code: Pascal  [Select][+][-]
  1.   Connection15Disp = dispinterface
  2.     ['{00000515-0000-0010-8000-00AA006D2EA4}']
  3.     property ConnectionString: WideString dispid 0;
  4.     property CommandTimeout: Integer dispid 2;
  5. ...
  6.     procedure Open(const ConnectionString: WideString; const UserID: WideString;
  7.       const Password: WideString; Options: Integer); dispid 10;
  8. ...
  9.  
  10.  
Code: [Select]
Errors: 23, Hints: 23
ADOInt.pas(1322,26) Error: Duplicate identifier "ConnectionString"
ADOInt.pas(1322,26) Hint: Identifier already defined in ADOInt.pas at line 1312
ADOInt.pas(1364,26) Error: Duplicate identifier "ConnectionString"
ADOInt.pas(1364,26) Hint: Identifier already defined in ADOInt.pas at line 1354
...(21 more...)

Seems it takes the parameter name for a property...
Sorry if sound like a stupid question, but what's wrong ?
« Last Edit: June 26, 2020, 05:02:40 pm by CapelliC »

Bart

  • Hero Member
  • *****
  • Posts: 4360
    • Bart en Mariska's Webstek
Probably you use {$mode objfpc}

Use
Code: Pascal  [Select][+][-]
  1. procedure Open(const AConnectionString: ...)
instead as a procedure declaration, or switch to {$mode delphi}, where this is allowed.

Bart

CapelliC

  • Jr. Member
  • **
  • Posts: 58
Thanks, changed to {$mode delphi}, that worked.

 

TinyPortal © 2005-2018