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