Foxtable(狐表)用户栏目专家坐堂 → 查询有更简单的办法吗


  共有2793人关注过本帖树形打印复制链接

主题:查询有更简单的办法吗

帅哥哟,离线,有人找我吗?
狐狸爸爸
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2016/7/24 7:34:00 [显示全部帖子]

Dim Filter As String
Dim cls() as String = ("列1","列2","列3")
Dim ops() AS string = ("=" ,"=",">")
dim nms() as string = {"TextBox1","TextBox2","TextBox3"}
for i as integer = 0 to  nms.length -1
   if  e.form.Controls(nm).Value is not nothing then
         if filter > "" then
             filtter = filter & " And "
         end if
         dim prefix as string = ""
         if datatables("表名").DataCols(cls(i)).Isdate then
            prefix = "#"
         elsieif datatables("表名").DataCols(cls(i)).IsString then
           prefix = “‘”
         end if
         filter = filter & cls(i) & ops(i) & prefix & e.form.Controls(nm).Value & prefix
   end if
next
。。。。


 回到顶部