CoUninitialize(); } void PrintProviderError(_ConnectionPtr pConnection) { ErrorPtr pErr = NULL; if( (pConnection->Errors->Count) > 0) { long nCount = pConnection->Errors->Count; // Collection ranges from 0 to nCount -1. for(long i = 0;i < nCount;i++) { pErr = pConnection->Errors->GetItem(i); CString strError; strError.Format("Error number: %x\t%s", pErr->Number, pErr->Description); AfxMessageBox(strError); } } } void PrintComError(_com_error &e) { _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); // Print COM errors. CString strError; strError.Format("Error number: Description = %s\tCode meaning = %s",(LPCSTR) bstrDescription, e.ErrorMessage()); AfxMessageBox(strError); } 调用方法: CString strFileName; TCHAR FileName[MAX_PATH]; TCHAR bigBuff[2048] = _T(""); // maximum common dialog buffer size TCHAR szFilter[] = _T("Text Files (*.mdb)|*.mdb|All Files (*.*)|*.*||"); CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT, szFilter); // Modify OPENFILENAME members directly to point to bigBuff dlg.m_ofn.lpstrFile = bigBuff; dlg.m_ofn.nMaxFile = sizeof(bigBuff); if(IDOK == dlg.DoModal() ) { strFileName = dlg.GetPathName(); lstrcpy(FileName,strFileName); OpenSchemaX(FileName); } 希望看到更多更经典的开发技巧,请随时刷新《开发特区》栏目。 |
正在阅读:获取ACCESS2000数据库中所有表的名称获取ACCESS2000数据库中所有表的名称
2004-04-29 14:58
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键