⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 text1.txt

📁 此程序是利用VB来开发的
💻 TXT
字号:
_RecordsetPtr pSet;
HRESULT hr;
try
{ 
hr = m_pConnect.CreateInstance("ADODB.Connection");   
if(SUCCEEDED(hr)) 
{  
CString dd;  
dd.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s",file);  
hr = m_pConnect->Open((_bstr_t)dd,"","",adModeUnknown);  
pSet = m_pConnect->OpenSchema(adSchemaTables);     
while(!(pSet->adoEOF))  
{        
//????   
_bstr_t table_name = pSet->Fields->GetItem("TABLE_NAME")->Value;

//??????       
_bstr_t table_type = pSet->Fields->GetItem("TABLE_TYPE")->Value;

//????,???????,?????
if ( strcmp(((LPCSTR)table_type),"TABLE")==0){
CString tt;
tt.Format("%s",(LPCSTR)table_name);    
AfxMessageBox(tt);       
}      
pSet->MoveNext();   
}  
pSet->Close(); 
} 
m_pConnect->Close(); 
}catch(_com_error e)///????
{ 
CString errormessage; 
errormessage.Format("???????!rn????:%s",e.ErrorMessage());

AfxMessageBox(errormessage);
return -1;
}
Field *   field = NULL;
HRESULT   hr;
Fields *  fields = NULL;
hr = m_pRecordset->get_Fields (&fields);//??????????
 
if(SUCCEEDED(hr))
    fields->get_Count(&ColCount);

//??????????????????
for(i=0;iItem[i]->get_Name(&bstrColName);//?????//?????
strColName=bstrColName;
nameField = strColName;
m_FieldsList.AddString(nameField);
}
if(SUCCEEDED(hr))
fields->Release();//????

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -