Command Object and IColumnsRowset



Hi,

I am trying to use ADO to retrieve information about a SQL Statement
that I am executing. In my searches on MSDN I came across the Command
Object and saw that it had dynamic properties to retrieve information
like the "BASE Table name" or "BASE column name". This information
would be very useful to me. But honestly I could not figure out how
to get this to work at all!

Here is some code that I wrote in C++.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

MYADO::PropertyPtr pProperty =
pCommandPtr->GetProperties()-

GetItem( CComVariant(_T("IColumnsRowset")));

VARIANT nVariant = pProperty->GetValue();
if ( ( nVariant.vt == VT_BOOL ) && ( V_BOOL( &nVariant ) ==
VARIANT_TRUE ) )
{
CComQIPtr< IColumnsRowset > pMyColumnInfo =
pCommandPtr.GetInterfacePtr();
if ( pMyColumnInfo != NULL )
{
// Get the rowset information
}

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

But pMyColumnInfo is always NULL?

I really need an example that would show me how to from the Command
Object extract detailed information about each column in the
statement.

For me this would be similar to the ODBC methods SQLGetColumnAttr.

Regards,
Mohan

.



Relevant Pages

  • Re: Command Object and IColumnsRowset
    ... I am trying to use ADO to retrieve information about a SQL Statement ... In my searches on MSDN I came across the Command ... CComQIPtrpMyColumnInfo = ...
    (microsoft.public.data.oledb)
  • How To Do It Faster?!?
    ... I had to kill Python after having issued that command because ... In my first mail, I said I have to work with a BIG directory (more than ... TB) and I need to retrieve information when they become available (I put ... this info on a wxPython ListCtrl). ...
    (comp.lang.python)
  • Command Object and IColumnsRowset
    ... I am trying to use ADO to retrieve information about a SQL Statement ... CComQIPtrpMyColumnInfo = ... I really need an example that would show me how to from the Command ...
    (microsoft.public.data.ado)
  • Between Expression searching between alpha / #s - Using Access Form
    ... with a command button which will search for information and put this ... EXAMPLE OF FORM LAYOUT: ... (LABEL OR TEXT BOX HERE) -- the information now shows ...
    (microsoft.public.access.queries)