婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 獲取ACCESS2000數(shù)據(jù)庫中所有表的名稱

獲取ACCESS2000數(shù)據(jù)庫中所有表的名稱

熱門標簽:機器人電話機創(chuàng)意繪畫 天音通信電話機器人 杭州400電話如何申請的 高德地圖標注商家在哪 江西南昌百應(yīng)電話機器人 400電話從哪里申請濱州 隨州營銷電話機器人怎么樣 400電話申請怎么看 hbuilder地圖標注

void OpenSchemaX(TCHAR *TableName)
{
HRESULT hr = S_OK;

::CoInitialize(NULL); //初始化Com

IADORecordBinding *picRs = NULL;

_RecordsetPtr pRstSchema("ADODB.Recordset");
_ConnectionPtr pConnection("ADODB.Connection" );

pConnection->ConnectionString = TableName;
pConnection->Provider = "Microsoft.Jet.OLEDB.4.0";

try
{
pConnection->Open(pConnection->ConnectionString, "", "", adModeUnknown);
pRstSchema->QueryInterface(
__uuidof(IADORecordBinding), (LPVOID*)picRs);

pRstSchema = pConnection->OpenSchema(adSchemaTables);//枚舉表的名稱處理

while(!(pRstSchema->EndOfFile))
{
CString strTableType;

_bstr_t table_name = pRstSchema->Fields->
GetItem("TABLE_NAME")->Value;//獲取表的名稱

_bstr_t table_type = pRstSchema->Fields->
GetItem("TABLE_TYPE")->Value;//獲取表的類型

strTableType.Format("%s",(LPCSTR) table_type);

if(!lstrcmp(strTableType,_T("TABLE")))
{
m_strList.AddString((LPCSTR) table_name);//添加表的名稱
}

pRstSchema->MoveNext();
}
// Clean up objects before exit.

pRstSchema->Close();
pConnection->Close();
}

catch (_com_error e)
{
// Notify the user of errors if any.
// Pass a connection pointer accessed from the Connection.
PrintProviderError(pConnection);
PrintComError(e);
}
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);
}

調(diào)用方法:

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);
}(出處:風(fēng)閃網(wǎng)路學(xué)院)

標簽:昆明 鶴崗 常德 招商 石嘴山 葫蘆島 保定 沈陽

巨人網(wǎng)絡(luò)通訊聲明:本文標題《獲取ACCESS2000數(shù)據(jù)庫中所有表的名稱》,本文關(guān)鍵詞  獲取,ACCESS2000,數(shù)據(jù)庫,中,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《獲取ACCESS2000數(shù)據(jù)庫中所有表的名稱》相關(guān)的同類信息!
  • 本頁收集關(guān)于獲取ACCESS2000數(shù)據(jù)庫中所有表的名稱的相關(guān)信息資訊供網(wǎng)民參考!
  • 企业400电话

    智能AI客服机器人
    15000

    在线订购

    合计11份范本:公司章程+合伙协议+出资协议+合作协议+股权转让协议+增资扩股协议+股权激励+股东会决议+董事会决议

    推薦文章
    主站蜘蛛池模板: 葵青区| 昌乐县| 延长县| 甘德县| 怀集县| 正安县| 额济纳旗| 高州市| 莱西市| 济南市| 株洲市| 苏尼特左旗| 邮箱| 河源市| 宜宾市| 靖安县| 云林县| 舒兰市| 乐平市| 修文县| 阜康市| 天长市| 永善县| 高州市| 嘉祥县| 磴口县| 印江| 奉贤区| 台东县| 团风县| 锡林浩特市| 汕尾市| SHOW| 沙田区| 和林格尔县| 即墨市| 石首市| 商河县| 南靖县| 沁源县| 基隆市|