I have an ATL component that passes back an IDispatch of a _RecordsetPtr as the VT_DISPATCH of a VARIANT. e.g. STDMETHODIMP CBASE::GetRecordSet(BSTR sql, VARIANT *Result) { _variant_t vBuffer; ... vBuffer = static_cast(m_recordset); *Result = vBuffer.Detach(); } From my C++ MFC app I can call GetRecordSet() and access the recordset using the pdispVal of the VARIANT .... VARIANT Result; hr = IBaseInst->GetProfile( _bstr_t("SELECT name FROM emps"), &Result); _RecordsetPtr pRecordSet; pRecordSet = Result.pdispVal; if( !pRecordSet->adoEOF) { .... } I am trying to perform similar actions from an ASP page but do not know how to access the recordset correctly. I can access fields assuming they exist using: Dim rs rs = Ibase.GetRecordSet( "SELECT name FROM emps") gName = rs("name") But I can not do much else; rs.bof fails with 'Object doesn't support this property or method'. I obvioulsy need to do something to get at the recordset from the returned VARIANT, but what ? Can anyone help with suggestions or code examples.
User 3472
Posts
-
Accessing a _RecordsetPtr returned by ATL in ASP -
Accessing a _RecordsetPtr returned by ATL in ASPI have an ATL component that passes back an IDispatch of a _RecordsetPtr as the VT_DISPATCH of a VARIANT. e.g. STDMETHODIMP CBASE::GetRecordSet(BSTR sql, VARIANT *Result) { _variant_t vBuffer; ... vBuffer = static_cast(m_recordset); *Result = vBuffer.Detach(); } From my C++ MFC app I can call GetRecordSet() and access the recordset using the pdispVal of the VARIANT .... VARIANT Result; hr = IBaseInst->GetProfile( _bstr_t("SELECT name FROM emps"), &Result); _RecordsetPtr pRecordSet; pRecordSet = Result.pdispVal; if( !pRecordSet->adoEOF) { .... } I am trying to perform similar actions from an ASP page but do not know how to access the recordset correctly. I can access fields assuming they exist using: Dim rs rs = Ibase.GetRecordSet( "SELECT name FROM emps") gName = rs("name") But I can not do much else; rs.bof fails with 'Object doesn't support this property or method'. I obvioulsy need to do something to get at the recordset from the returned VARIANT, but what ? Can anyone help with suggestions or code examples.