CString str = "something";
CDaoDatabase db;
//db open
CDaoRecordset rs(&db);
rs.Open(AFX_DAO_USE_DEFAULT_TYPE,"select * from mydb");
COleVariant searched(str);
BOOL bFound = rs.Seek("=",searched);
对于此语句,VS2008 返回error C2664: 'BOOL CDaoRecordset::Seek(LPCTSTR,COleVariant *,COleVariant *,COleVariant *)' : cannot convert parameter 2 from 'COleVariant' to 'COleVariant *'.
如何将COleVariant
转换为指针?
使用地址运算符"&"
BOOL bFound = rs.Seek("=",&searched);