🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #5931

r/w property of ADOConnection type in COM-object

#5931
From: Max B Shahab
Date: Tue, 16 Jan 2001 17:55
54 lines
2242 bytes
I am writing an ActiveX library with ASP object (Delphi 5). In my COM-object
interface I need
to have the r/w property with type of ADO Connection (I want to transmit an
already
established in ASP page ADO Connection to my COM object, for example:

<%
   Set myConn=server.CreateObject("ADODB.connection")
   myConn.Open

   Set DelphiASPObj = Server.CreateObject("DBUpload.Upload")
   DelphiASPObj.ADOConn = myConn

   ...
%>

).

First, I used an Microsoft ActiveX Data Objects 2.1 Library in Type Library
Editor.
Second, I declared the r/w property in interface:

  [propget, id(0x00000003)]
  HRESULT _stdcall ADOConn([out, retval] _Connection ** Value );
  [propput, id(0x00000003)]
  HRESULT _stdcall ADOConn([in] _Connection * Value );

This is a part of source code below:

...

function Get_ADOConn: _Connection; safecall;
procedure Set_ADOConn(const Value: _Connection); safecall;

...

function TUpload.Get_ADOConn: _Connection;
begin
  result := dmDB.cnDB.ConnectionObject As Connection;
end;

...

procedure TUpload.Set_ADOConn(const Value: _Connection);
begin
  dmDB.cnDB.ConnectionObject := Value;     //row 65
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
end;

[Error] Upload.pas(65): Incompatible types: 'ADODB_TLB._Connection' and
'ADOInt._Connection'

How must I assign a Value ? Where did I mistake ? And am I whether correct
generally write?
Technical Details
Message-ID: <3a648b4d_1@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!bornews.borland.com!dnews!195.239.167.13

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,1ef888b8c0a83a90,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-01-16 10:04:02 PST
From: "Max B Shahab" <maxim@cic.volgadmin.ru>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: r/w property of ADOConnection type in COM-object
Date: Tue, 16 Jan 2001 20:55:36 +0300
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 195.239.167.13
Message-ID: <3a648b4d_1@dnews>
X-Trace: 16 Jan 2001 09:56:29 -0800, 195.239.167.13
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!bornews.borland.com!dnews!195.239.167.13