我做了一个数据库的查询模块,想实现任意字段的查询,其中窗体上有一个COMBOX,填充了我数据库内的所有表名.所有字段,即显示出来为: 表名.字段名
可是里面显示的全部是英文,不利于用户交互,我想把它们全部改为中文的,可是参考了这上面的相关帖子,说最好表名和字段名都用英文的,只好却步了.但是有没有办法解决呢,即将 表名.字段名 这些内容全部转化为显示中文名称.
可是里面显示的全部是英文,不利于用户交互,我想把它们全部改为中文的,可是参考了这上面的相关帖子,说最好表名和字段名都用英文的,只好却步了.但是有没有办法解决呢,即将 表名.字段名 这些内容全部转化为显示中文名称.
if txt1.text<>"" then
cx_str="select * from table where name='" & txt1.text & "'"
end if
if txt2.text<>"" then
if cx_str="" then
cx_str="select * from table where age='" & txt2.text & "'"
else
cx_str=cx_str & "and age='" & txt2.text & "'"
endif
end if
if txt3.text<>"" then
if cx_str="" then
cx_str="select * from table where cop='" & txt3.text & "'"
else
cx_str=cx_str & "and cop='" & txt3.text & "'"
endif
end if
if cx_str="" then
msgbox"没有指定查询条件!"
exit sub
else
rs.open cx_str,conn
if rs.eof and rs.bof then
msgbox"没有符合条件的记录"
else
.............
end if
end if
我要的是把显示在COMBOX里的表名和字段名都转换为中文名,然后还要在查询的时候又把它们全部都转换回英文以便查找
呵呵
不知行不行哦
select case sname
case "表一": convertname= "table1"
case "表二": convertname= "table2"
...
end select
end function
然后在combobox1的change或者click事件代码添加
combobox2.listindex=combobox1.listindex然后再用模糊查询(用的是combobox2.listindex)
随时都可能改变的,如果用添加的方法的话,不一定就中文和英文相对应的啊?