dbase file, its name is over 8bytes,can not open
i try open dbase file which filename is over 8bytes, using ado .
but i cannt .
the error message is 'can not find myDbase89.dbf file'.
but 'myDbase8.dbf' file opens well.
how do ...
please, look over the code following and help me....
//////////////////////////////////////////////////////////////////////////////
try{
CString pathStr =filePath;
stConnect.Format("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=%s;Extended Properties=dBase IV;",pathStr);
HRESULT hr;
hr = m_pConnection->Open( _bstr_t(stConnect.GetBuffer()), L"",L"",NULL);
stConnect.ReleaseBuffer();
CString sql;
sql.Format("Select * from %s",fileName);
m_pRecordset->Open( _bstr_t(sql), (IDispatch *)m_pConnection, adOpenStatic, adLockReadOnly,adCmdUnspecified);
if( FAILED(hr) ){
AfxMessageBox("can not open dbf file... ");
return;
}
}catch( _com_error &e )
{
CString err;
err.Format("%s : error msg --> %s", e.ErrorMessage() ,CString(_variant_t(e.Description())) );
AfxMessageBox( err );
return;
}
////////////////////////////////////////////////////////////////////////////////////////////////

