* ----------------------------------------------------------------------- \\ sql_count m_dbf="sys_menu" && \\ sql语句 m_name='' m_count=0 m_fields='sort' && \\ 统计某字段个数 m_while='where class=?m_class and bj=?m_bj' m_name='菜单表' DO cx\sql_count thisform.retu
* ------------------------------------------------------------------------------------------- \\ 取数据个数的程序 m_sql='select count('+'&m_fields'+') as count from '+m_dbf+' '+m_while m_retu=0 IF SQLEXEC(gnMyLogHandle,m_sql,'abcde') = -1 m_retu=1 AERROR( laError ) MESSAGEBOX( '读取数据库错误提示:' + ALLTRIM(STR(laError[ 1 ])) + CHR( 13 ) +laError[ 2 ]) ENDIF STRTOFILE(m_sql ,"c:\sql.TXT") * ------------------------------------------------------------------------------------------- \\ 检查是否出错 IF m_retu=1 MESSAGEBOX(m_sql) STRTOFILE(m_sql ,"c:\Error.TXT") MESSAGEBOX('请注意:系统在【取数据个数】数据【'+m_name+'】时,发生错误,请检查网络是否畅通或与系统管理员联系!'+m_message,48,m_message1) RETURN ENDIF SELECT abcde m_count=count