🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Import ADO type library

#875
From: Viatcheslav V. Vassiliev
Date: Tue, 05 Jul 2005 10:08
94 lines
3810 bytes
Try

DBCommand->CommandText = WideString(CmdStr);

break on next line and look what is in CommandText. Does it work for command 
without parameters?

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + 
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Angel" <user@example.net> ???????/???????? ? ???????? ?????????: 
news:42c91c7d$1@newsgroups.borland.com...
>I forgot to say that the connection is opened correctly (forgot to put the 
>line in the sample code that I posted), and that I have trouble only with 
>the Command object. The Recordset object has worked fine for me in other 
>functions.
>
> When I execute the command, after I have modified the CommandText 
> property, it is always empty (the commandtext property) and I get an error 
> (0x80040E0C-Empty commandtext) when I execute the command .
>
> Thanks again.
>
>
>
> Angel wrote:
>
>> 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: <42ca5c23$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42c91228$1@newsgroups.borland.com> <42c91c7d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,edb9422f973acd68
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <42c91228$1@newsgroups.borland.com> <42c91c7d$1@newsgroups.borland.com>
Subject: Re: Import ADO type library
Date: Tue, 5 Jul 2005 14:08:32 +0400
Lines: 96
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 85.93.138.132
Message-ID: <42ca5c23$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1120558115 85.93.138.132 (5 Jul 2005 03:08:35 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail