如查询单据号,并显示单据信息,谢谢!

解决方案 »

  1.   

    CDaoRecordset::GetFieldValue
    virtual void GetFieldValue( LPCTSTR lpszName, COleVariant& varValue );
    throw( CDaoException, CMemoryException );virtual void GetFieldValue( int nIndex, COleVariant& varValue );
    throw( CDaoException, CMemoryException );virtual COleVariant GetFieldValue( LPCTSTR lpszName );
    throw( CDaoException, CMemoryException );virtual COleVariant GetFieldValue( int nIndex );
    throw( CDaoException, CMemoryException );Return ValueThe two versions of GetFieldValue that return a value return a COleVariant object that contains the value of a field.ParameterslpszNameA pointer to a string that contains the name of a field.varValueA reference to a COleVariant object that will store the value of a field.nIndexA zero-based index of the field in the recordset’s Fields collection, for lookup by index.ResCall this member function to retrieve data in a recordset. You can look up a field by name or by ordinal position.Note   It is more efficient to call one of the versions of this member function that takes a COleVariant object reference as a parameter, rather than calling a version that returns a COleVariant object.Use GetFieldValue and SetFieldValue to dynamically bind fields at run time rather than statically binding columns using the DoFieldExchange mechanism.GetFieldValue and the DoFieldExchange mechanism can be combined to improve performance. For example, use GetFieldValue to retrieve a value that you need only on demand, and assign that call to a “More Information” button in the interface. For more information about binding fields dynamically, see the articleDAO Recordset: Binding Records Dynamically in Visual C++ Programmer's Guide. For related information, see the topics "Field Object" and "Value Property" in DAO Help.这些可以在msdn中,强烈建议多看msdn!