久久机这里只有精品,国产69精品一区二区亚洲孕妇,91精品国产综合久久婷婷香蕉,午夜久久久久久电影

最新活動:電腦PC端+手機端+微網(wǎng)站+自適應(yīng)網(wǎng)頁多模板選擇-建站388元起價!!!
當前位置:主頁 > 網(wǎng)站建設(shè) > 獲取ACCESS2000數(shù)據(jù)庫中所有表的名稱建站知識

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

時間:2023-05-23 22:05:23 閱讀: 文章分類: 網(wǎng)站建設(shè) 作者: 網(wǎng)站技術(shù)員

導(dǎo)讀:1建站知識void OpenSchemaX(TCHAR *TableName) { HRESULT hr = S_OK; ::CoInitialize(NULL); //個業(yè)網(wǎng)站建設(shè)公司seo網(wǎng)站關(guān)鍵詞優(yōu)化。

個業(yè)網(wǎng)站建設(shè)公司seo網(wǎng)站關(guān)鍵詞優(yōu)化

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 pErrseo網(wǎng)站關(guān)鍵詞優(yōu)化 = 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];

關(guān)鍵詞標簽: 名稱 數(shù)據(jù)庫中

聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-05-23 ,文章獲取ACCESS2000數(shù)據(jù)庫中所有表的名稱建站知識主要講述數(shù)據(jù)庫中,名稱,獲取ACCESS2000數(shù)據(jù)庫中所有表的名網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_6106.html

我的IDC 網(wǎng)站建設(shè)技術(shù)SEOUC.COM
專注網(wǎng)站建設(shè),SEO優(yōu)化,小程序設(shè)計制作搭建開發(fā)定制網(wǎng)站等,數(shù)千家網(wǎng)站定制開發(fā)案例,網(wǎng)站推廣技術(shù)服務(wù)。
  • 5000+合作客服
  • 8年從業(yè)經(jīng)驗
  • 150+覆蓋行業(yè)
  • 最新熱門源碼技術(shù)文章

    主站蜘蛛池模板: 隆德县| 迭部县| 锦州市| 凤翔县| 视频| 玛纳斯县| 平乐县| 达孜县| 德州市| 即墨市| 三台县| 新丰县| 石门县| 双鸭山市| 沙洋县| 东方市| 永登县| 贡嘎县| 独山县| 锡林浩特市| 九江市| 佛教| 高淳县| 永平县| 祥云县| 隆安县| 安庆市| 西峡县| 新沂市| 博罗县| 拜城县| 工布江达县| 张家界市| 洱源县| 阿尔山市| 南丹县| 仁寿县| 牡丹江市| 梁河县| 海阳市| 谢通门县|