I have a problem with ODBC 3.51 Driver 2007-01-02 - By le huynh
Back
I connect via ODBC 3.51 Driver use VC6.0, all data in report are OK except image field (blob). There is no image in this field showed. This is my coding below:
IReportPtr m_Report; ADODB::_ConnectionPtr Conn = NULL; ADODB::_RecordsetPtr RS;
HRESULT hr = Conn.CreateInstance( __uuidof( ADODB::Connection ) ); ASSERT(SUCCEEDED(hr))
CString strConn; strConn.Format("DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=xxx;UID=xxx;PWD=xxx;OPTION=3;");
_bstr_t bstrAccessConnect = strConn.AllocSysString();
Conn->ConnectionString = bstrAccessConnect;
_bsrt_t bstrEmpty(L"");
Conn->Open(bstrEmpty,bstrEmpty,bstrEmpty,-1);
RS.CreateInstance(__uuidof(ADODB::Recordset)); RS->Open((_bstr_t)strSQL, _variant_t((IDispatch *)Conn, true), ADODB::adOpenStatic, ADODB::adLockReadOnly, ADODB::adCmdText);
VARIANT var; VariantInit(&var);
var.vt = VT_DISPATCH; var.pdispVal = (IDispatch*)RS; hr = m_Report->Database->SetDataSource(var);
hr = m_Report->put_SQLQueryString(());
Can you help me?
Thanks.
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
|
|