关于ado与foxpro数据库,200分求解
zlhcc 2003-11-29 01:14:57 我已经连接上foxpro数据库了。
_bstr_t conn("Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDb=c:\\111.dbf");
m_pConnection.CreateInstance (__uuidof(Connection));
m_pConnection->Open (conn,"","",adModeUnknown);
_RecordsetPtr pRstSchema = NULL;
pRstSchema = m_pConnection->OpenSchema(adSchemaTables);
while(!(pRstSchema->adoEOF))
{
_bstr_t table_name = pRstSchema->Fields->GetItem("TABLE_NAME")->Value;
printf("Table Name: %s\n",(LPCSTR) table_name);
_bstr_t table_type = pRstSchema->Fields->GetItem("TABLE_TYPE")->Value;
printf("Table type: %s\n\n",(LPCSTR) table_type);
pRstSchema->MoveNext();
}
问题是明明我的数据库文件中有数据,但我在获取表结构信息时,就是得不到,也就是说,不进入while的内部执行