首页 > 开发 > Asp > 正文

asp下检查表中是否存在某个字段(列)函数

2020-06-20 13:09:50
字体:
来源:转载
供稿:网友

复制代码 代码如下:
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    

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表