Access从罗斯文数据库中修改的拼音助记码函数
- 2017-09-01 16:05:00
- todaynew-Office交流网 原创
- 5010
Public Function PinYin(Tstr As String) As Long
Dim I As Long
I = Asc(Tstr)
If I >= Asc("啊") And I < Asc("芭") Then PinYin = 1
If I >= Asc("芭") And I < Asc("擦") Then PinYin = 2
If I >= Asc("擦") And I < Asc("搭") Then PinYin = 3
If I >= Asc("搭") And I < Asc("蛾") Then PinYin = 4
If I >= Asc("蛾") And I < Asc("发") Then PinYin = 5
If I >= Asc("发") And I < Asc("噶") Then PinYin = 6
If I >= Asc("噶") And I < Asc("哈") Then PinYin = 7
If I >= Asc("哈") And I < Asc("击") Then PinYin = 8
If I >= Asc("击") And I < Asc("喀") Then PinYin = 9
If I >= Asc("喀") And I < Asc("垃") Then PinYin = 10
If I >= Asc("垃") And I < Asc("妈") Then PinYin = 11
If I >= Asc("妈") And I < Asc("拿") Then PinYin = 12
If I >= Asc("拿") And I < Asc("哦") Then PinYin = 13
If I >= Asc("哦") And I < Asc("啪") Then PinYin = 14
If I >= Asc("啪") And I < Asc("欺") Then PinYin = 15
If I >= Asc("欺") And I < Asc("然") Then PinYin = 16
If I >= Asc("然") And I < Asc("撒") Then PinYin = 17
If I >= Asc("撒") And I < Asc("塌") Then PinYin = 18
If I >= Asc("塌") And I < Asc("挖") Then PinYin = 19
If I >= Asc("挖") And I < Asc("昔") Then PinYin = 20
If I >= Asc("昔") And I < Asc("压") Then PinYin = 21
If I >= Asc("压") And I < Asc("匝") Then PinYin = 22
If I >= Asc("匝") And I <= Asc("座") Then PinYin = 23
End Function
经过修改后,可以成为拼音助记码函数,详细源码:
Public Function PinYin(Tstr As String) As String
Dim I As String
I = Asc(Tstr)
If I >= Asc("啊") And I < Asc("芭") Then PinYin = "a"
If I >= Asc("芭") And I < Asc("擦") Then PinYin = "b"
If I >= Asc("擦") And I < Asc("搭") Then PinYin = "c"
If I >= Asc("搭") And I < Asc("蛾") Then PinYin = "d"
If I >= Asc("蛾") And I < Asc("发") Then PinYin = "e"
If I >= Asc("发") And I < Asc("噶") Then PinYin = "f"
If I >= Asc("噶") And I < Asc("哈") Then PinYin = "g"
If I >= Asc("哈") And I < Asc("击") Then PinYin = "h"
If I >= Asc("击") And I < Asc("喀") Then PinYin = "j"
If I >= Asc("喀") And I < Asc("垃") Then PinYin = "k"
If I >= Asc("垃") And I < Asc("妈") Then PinYin = "l"
If I >= Asc("妈") And I < Asc("拿") Then PinYin = "m"
If I >= Asc("拿") And I < Asc("哦") Then PinYin = "n"
If I >= Asc("哦") And I < Asc("啪") Then PinYin = "o"
If I >= Asc("啪") And I < Asc("欺") Then PinYin = "p"
If I >= Asc("欺") And I < Asc("然") Then PinYin = "q"
If I >= Asc("然") And I < Asc("撒") Then PinYin = "r"
If I >= Asc("撒") And I < Asc("塌") Then PinYin = "s"
If I >= Asc("塌") And I < Asc("挖") Then PinYin = "t"
If I >= Asc("挖") And I < Asc("昔") Then PinYin = "w"
If I >= Asc("昔") And I < Asc("压") Then PinYin = "x"
If I >= Asc("压") And I < Asc("匝") Then PinYin = "y"
If I >= Asc("匝") And I <= Asc("座") Then PinYin = "z"
If Not (I >= Asc("芭") And I <= Asc("座")) Then PinYin = Tstr
py_Exit:
Exit Function
py_Err:
PinYin = ""
Resume py_Exit
End Function
这里有点bug,用ASC不行,好多字出不来,特别是药品化学名。
(算法函数_API_系统-相关文章技巧链接):
支持拼音首字母的组合框函数及实例
Access数据库自身
- office课程播放地址及课程明细
- Excel Word PPT Access VBA等Office技巧学习平台
- 将( .accdb) 文件格式数据库转换为早期版本(.mdb)的文件格式
- 将早期的数据库文件格式(.mdb)转换为 (.accdb) 文件格式
- KB5002984:配置 Jet Red Database Engine 数据库引擎和访问连接引擎以阻止对远程数据库的访问(remote table)
- Access 365 /Access 2019 数据库中哪些函数功能和属性被沙箱模式阻止(如未启动宏时)
- Access Runtime(运行时)最全的下载(2007 2010 2013 2016 2019 Access 365)
Access Activex第三方控件
- Activex控件或Dll 在某些电脑无法正常注册的解决办法(regsvr32注册时卡住)
- office使用部分控件时提示“您没有使用该ActiveX控件许可的问题”的解决方法
- RTF文件(富文本格式)的一些解析
- Access树控件(treeview) 64位Office下出现横向滚动条不会自动定位的解决办法
- Access中国树控件 在win10电脑 节点行间距太小的解决办法
- EXCEL 2019 64位版(Office 2019 64位)早就支持64位Treeview 树控件 ListView列表等64位MSCOMMCTL.OCX控件下载
- VBA或VB6调用WebService(直接Post方式)并解析返回的XML
Access ADP Sql Server等
- 早期PB程序连接Sqlserver出现错误
- MMC 不能打开文件C:/Program Files/Microsoft SQL Server/80/Tools/Binn/SQL Server Enterprise Manager.MSC 可能是由于文件不存在,不是一个MMC控制台,或者用后来的MMC版
- sql server连接不了的解决办法
- localhost与127.0.0.1区别
- Roych的浅谈数据库开发系列(Sql Server)
- sqlserver 自动备份对备份目录没有存取权限的解决办法
- 安装Sql server 2005 express 和SQLServer2005 Express版企业管理器 SQLServer2005_SSMSEE
文章分类
联系我们
联系人: | 王先生 |
---|---|
Email: | 18449932@qq.com |
QQ: | 18449932 |
微博: | officecn01 |