| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 644 人关注过本帖
标题:拼音查询代码怎么写???
只看楼主 加入收藏
nhygm888
Rank: 2
等 级:论坛游民
威 望:1
帖 子:186
专家分:42
注 册:2008-7-20
结帖率:64.71%
收藏
已结贴  问题点数:50 回复次数:1 
拼音查询代码怎么写???
if empty(allt(thisform.text5.value))
messagebox("你没有录入姓名",0+64+0,"提示")
else
xm2=allt(thisform.text5.value)
py1=topy(xm2)
if len(xm2)<3
xm4=xm2
endi
if len(xm2)=4
xm4=substr(xm2,1,2)
xm5=substr(xm2,3,2)
endi
if len(xm2)=6
xm6=substr(xm2,5,2)
xm4=substr(xm2,1,2)
xm5=substr(xm2,3,2)
endi
if thisform.Check1.value=1 .and. thisform.Check2.value=0
do case
   case len(xm2)=2
 select * from 第二批删除人员20091116 where OCCURS(xm4,个人姓名)>0 into table aaaaaa   
   case len(xm2)=4
 select * from 第二批删除人员20091116 where OCCURS(xm4,个人姓名)>0 and OCCURS(xm5,个人姓名)>0 into table aaaaaa  
   case len(xm2)=6
 select * from 第二批删除人员20091116 where OCCURS(xm4,个人姓名)>0 and OCCURS(xm5,个人姓名)>0 and OCCURS(xm6,个人姓名)>0 into table aaaaaa
endc
endi
if thisform.Check1.value=0 and thisform.Check2.value=1
 select * from 第二批删除人员20091116 where OCCURS(py1,py)>0 into table aaaaaa  
endi
if thisform.Check2.value=1 and thisform.Check1.value=1
do case
   case len(xm2)=2
 select * from 第二批删除人员20091116 where OCCURS(xm4,个人姓名)>0 and OCCURS(py1,py)>0 into table aaaaaa
   case len(xm2)=4
 select * from 第二批删除人员20091116 where OCCURS(xm4,个人姓名)>0 and OCCURS(xm5,个人姓名)>0 or OCCURS(py1,py)>0 into table aaaaaa   
   case len(xm2)=6
 select * from 第二批删除人员20091116 where OCCURS(xm4,个人姓名)>0 and OCCURS(xm5,个人姓名)>0 and OCCURS(xm6,个人姓名)>0 or OCCURS(py1,py)>0 into table aaaaaa     
endc
endi
endi
thisform.grid1.recordsource="aaaaaa"

thisform.sxsx
SELECT cx2
SCAN ALL
This.Nodes.Add(,,"ch"+ALLTRIM(cx2.个人编号),ALLTRIM(cx2.个人姓名)+" "+ALLTRIM(cx2.身份证),1)
sele jfls1
SCAN for jfls1.grbh=cx2.个人编号
This.NODES.ADD("CH"+ALLTR(jfls1.jfsq),4,,ALLTR(jfls1.grjfjs)+" "+ALLTR(jfls1.grjfbs)+" "+ALLTR(jfls1.grjfbs),2)
ENDSCAN
ENDSCAN

这个 是我自己写的  大家不要笑我啊 !!!
thisform.Check1.value=1是模糊查询
thisform.Check2.value=1是拼音查询
全选的时候 就不出来了  大家帮我看看
能把我的代码简化就好了  谢谢!!~~~


我要完成的效果是:
有个 数据表 记录有16万多条
表的结构是:个人编号,个人姓名,身份证,....
在一个表单中 输入姓名 张三  表中的姓名字段
叫 张三一,张一三,张山什么的和 张什么山的都能出来.
大家有时间 帮我做下  给我思路也行  我做完代码 在传上来...........
搜索更多相关主题的帖子: 查询 代码 拼音 
2010-01-04 16:17
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
收藏
得分:50 
xm1=allt(thisform.text5.value)
if empty(xm1)
  messagebox("你没有录入姓名",0+64+0,"提示")
else
  py1=topy(xm1)
  xm2='%'
  for i=1 to lenc(xm1)
    xm2=xm2+substrc(xm1,i,1)+'%'
  endfor
  py2='%'
  for i=1 to len(py1)
    py2=py2+substr(py1,i,1)+'%'
  endfor
  do case
    case thisform.Check1.value=1 .and. thisform.Check2.value=0
      select * from 第二批删除人员20091116 where 个人姓名 like xm2 into table aaaaaa
    case thisform.Check1.value=0 and thisform.Check2.value=1
      select * from 第二批删除人员20091116 where py like py2 into table aaaaaa
    case thisform.Check2.value=1 and thisform.Check1.value=1
      select * from 第二批删除人员20091116 where 个人姓名 like xm2 or py like py2 into table aaaaaa
    case thisform.Check2.value=0 and thisform.Check1.value=0
      messagebox("请您选择查询方式",0+64+0,"提示")
  endcase
endi
thisform.grid1.recordsource="aaaaaa"

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2010-01-05 00:20
快速回复:拼音查询代码怎么写???
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018331 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved