作者在 2018-08-22 22:25:46 发布以下内容
* 生成数据库中表结构明细
CLOSE DATABASES ALL
SET SAFETY OFF
CREATE TABLE Made_Dbf\T_Name (表名 c(30),字段名 c(20),字段说明 c(100),字段类型 c(1),索引类型 c(10),索引方式 c(4),宽度 n(3),小数位 n(1),表说明 c(100))
OPEN DATABASE Made_Dbf\Comm_Dbf
nTables=ADBOBJECTS(aTable,"TABLE")
=ASORT(aTable)
FOR i=1 TO nTables
USE ("Made_Dbf\"+aTable(i)) IN 0 ALIAS aa
SELECT aa
=AFIELDS(azd)
nVal=ATAGINFO(adx,"made_dbf\"+aTable(i)+".cdx")
FOR ii=1 TO FCOUNT()
cStra=""
cStrb=""
IF nVal>0
FOR iii=1 TO ALEN(adx,1)
IF adx[iii,3]==azd[ii,1]
cStra=adx[iii,2]
cStrb=adx[iii,5]
EXIT
ENDIF
ENDFOR
ENDIF
cme=DBGETPROP(aTable(I)+"."+azd[ii,1], "Field", "Comment")
INSERT INTO T_Name VALUES (azd[ii,12],azd[ii,1],cme,azd[ii,2],cStra,cStrb,azd[ii,3],azd[ii,4],azd[ii,16])
ENDFOR
USE IN aa
ENDFOR
SELECT T_Name
BROWSE