Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
修改了几处:Forms("药物使用说明").Controls("DataList1")的属性和CurrentChanged事件,增加AfterLoad事件,增加撤销查找代码。
重点修改“查找”按钮代码如下:
dim txt as winform.textbox=e.form.controls("textbox1")
dim cb As WinForm.CheckBox = e.Form.Controls("CheckBox1")
dim st,fd as string
dim s as string() ={ "RadioButton1","RadioButton2","RadioButton3","RadioButton4","中文名","英文名","类别","拼音码" }
for i as integer =0 to 3
if e.form.controls(s(i)).checked =true then
st =s(i+4)
end if
next
if txt isnot nothing then
if cb.Checked then
fd = " = '" & txt.value & "'" ‘等于
else
fd= " like '*" & txt.value & "*'" ’包含
end if
end if
tables("药物手册").filter="[" & st & "]" & fd 内部表包含查询用“*”
Dim cmd As New SQLCommand
Dim dt As DataTable
IF ST <> "中文名" THEN
cmd.CommandText = "Select 中文名," & st & " From {药物手册} where " & st & fd.Replace("*","%") ‘sql语句中包含查询用“%”
ELSE
cmd.CommandText = "Select 中文名 From {药物手册} where " & st & fd.Replace("*","%")
END IF
dt = cmd.ExecuteReader() '生成统计表
Dim dst As WinForm.DataList = Forms("药物使用说明").Controls("DataList1")
dst.DataTable = Dt
dst.Build()
下载信息 [文件大小: 下载次数: ] | |
点击浏览该文件:数据查找显示.table |
非常感谢 yuanbin,问题基本解决,但有一个小问题,就是在进行类别查询的时候出现错误提示,如果把类别内容中的“\”用“-”代替后查询即正常,不知是啥原因。
这个是tables的.filter处理“\”时出现的问题.这个直接在表中进行文本包含筛选和高级筛选都出现同样问题.要请狐狸他爸看看了.