asp下检查表中是否存在某个字段(列)函数
程序员文章站
2023-01-24 23:07:23
复制代码 代码如下:function checkfields(fieldsname,tablename)  ...
复制代码 代码如下:
function checkfields(fieldsname,tablename)
flag=false
sql="select * from "&tablename
set rs=conn.execute(sql)
for i = 0 to rs.fields.count - 1
if rs.fields(i).name=fieldsname then
flag=true
exit for
else
flag=false
end if
next
checkfields=flag
end function