我想知道我的数据表有多少个字段,该怎么办?

dbcz444 2003-03-07 01:20:10
我想知道我的数据表有多少个字段,该怎么办?(不确定,有很多)
...全文
48 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiolig 2003-03-07
  • 打赏
  • 举报
回复
FCount应该可以的(rida的笔误)。
dbcz444 2003-03-07
  • 打赏
  • 举报
回复
focunt函数不行.RIDA:有函数操作的吗?因为这太复杂了.或有FOXPRO 指令操作的吗?
rida 2003-03-07
  • 打赏
  • 举报
回复
可能还有别的方法。
select objectid, objectname from ridadbf.dbc ;
where allt(objecttype)=='Table' into cursor tablename


select t1.* ;
from ridadbf.dbc t1 ;
where allt(objecttype)=='Field' ;
into cursor fieldname


select t2.objectname as tablename, count(*) as fieldcount ;
from fieldname t1, tablename t2 ;
where t1.parentid=t2.objectid ;
into cursor tablefieldcount ;
group by t1.parentid


把我上面的ridadbf.dbc 改成你的数据库的名称,要注数据库文件所在的路径。
如果你的表不在数据库中你可建一数据库把表加入到数据库中。

可以这样加的
OPEN DATABASE ridadbf
set database to ridadbf
for i=1 to adir(ff,".\cp\*.dbf")
add table ".\cp\"+ff(i,1)
endfor

Mason-Ma 2003-03-07
  • 打赏
  • 举报
回复
格式:Focunt([<N型表达式>])
Focunt函数用于测试指定工作区数据库文件的字段数。若指定工作区无文件打开,则返回0
若未指定<N型表达式>,则对当前工作区操作。

2,747

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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