Article View: borland.public.cppbuilder.database.ado
Article #868Import ADO type library
From: Angel
Date: Mon, 04 Jul 2005 10:39
Date: Mon, 04 Jul 2005 10:39
61 lines
2581 bytes
2581 bytes
Hello to all.
(BCB6 Enterprise)
I have imported the Microsoft ActiveX Data Objects 2.8 Library, because
i have to make an application that doesn't use ADOExpress.
I use the imported objects in this function:
HRESULT __fastcall ADODatabase::ExecuteCmd(wchar_t* CmdStr,VARIANT* pParams)
{
HRESULT hr = -1;
ConnectionPtr DBConn;
CommandPtr DBCommand;
RecordsetPtr RecTemp;
try
{
hr=DBConn.CreateInstance(CLSID_Connection);
if(SUCCEEDED(hr))
{
RecTemp.CreateInstance(CLSID_Recordset);
hr = pDBCommand.CreateInstance(CLSID_Command);
if(SUCCEEDED(hr))
{
DBCommand->CommandText = CmdStr;
DBCommand->ActiveConnection = DBConn;
RecTemp = DBCommand->Execute( TVariantInParam(1),
Params,
adCmdText);
}
}
}
catch(...)
{
hr = -1;
}
return hr;
}
but I always get a compiling error ('CommandText is not accessible').
I have edited the ADODB_TLB.h file, changing the lines where the
property CommandText is defined to define the write part of the property
in this way:
__property BSTR CommandText = {read = get_CommandText};
//original line
__property BSTR CommandText = {read = get_CommandText
write = put_CommandText}; //Line modified by me
but I cannot get the command to work
I think that Tlibimp is buggy, and also is the Import type library
option of the menu.
Any suggestion? I repeat that i cannot use ADOExpress.
Thanks in advance.
Technical Details
Message-ID:
<42c91228$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,edb9422f973acd68,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 04 Jul 2005 12:39:59 +0200 From: Angel <user@example.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.7) Gecko/20050414 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.ado Subject: Import ADO type library Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.37.37.240 Message-ID: <42c91228$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1120473640 213.37.37.240 (4 Jul 2005 03:40:40 -0700) Lines: 61 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail