关于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的内部执行
...全文
32 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zlhcc 2003-11-29
  • 打赏
  • 举报
回复
知道了,谢谢
yintongshun 2003-11-29
  • 打赏
  • 举报
回复
_bstr_t conn("Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDb=c:\\");

saucer 2003-11-29
  • 打赏
  • 举报
回复
try

_bstr_t conn("Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDb=c:\\");

4,012

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧